Operating Systems 2018F Lecture 18: Difference between revisions
Created page with "==To Do== * strace memoryll * uid vs euid * scheduling and __schedule" |
R.samanfar (talk | contribs) |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
==To Do | ==Video== | ||
The video from the lecture given on November 14, 2018 [https://homeostasis.scs.carleton.ca/~soma/os-2018f/lectures/comp3000-2018f-lec18-20181114.m4a is now available]. | |||
==Notes== | |||
What is dev/fuse | |||
How did i do a mount | |||
Mount is a priveleged operation normally, it lets you shadow entire portions of the filesystem | |||
fusermount breaks under strace | |||
bin/fusermount is red because of the 's' permission bit. | |||
'''What is the 's' permission bit?''' | |||
s stands for setuid in the owner position, and setgid in the group position. | |||
It allows a program to run with privileges different from the process that did the execve | |||
Normally execve of a process will run as the user (the uid that is currently running) | |||
'''setuid''' gives it the privileges of root instead | |||
'''getuid()''' is who ran the process | |||
'''geteuid()''' is with what privelges is this process running | |||
normally these are equal, but it changes when you run '''setuid''' | |||
(same thing for gid) | |||
If you run memoryll as root, the mnt point and all the files under it are exclusive to root | |||
One of the features of userspace mounting of filesystems, is that they are exclusive to the user that mounted them. | |||
'''getattr()''' | |||
'''system calls''' | |||
writev and read, its a way of using multiple buffers | |||
mount - mounts dev/fuse and fd 3 | |||
===In Class=== | |||
<pre> | |||
Lecture 18 | |||
---------- | |||
To Do | |||
----- | |||
strace memoryll | |||
uid vs euid | |||
scheduling and __schedule | |||
Optional reading: | |||
https://utcc.utoronto.ca/~cks/space/blog/unix/RawTtyInputThenAndNow | |||
Scheduling | |||
---------- | |||
System calls => enter supervisor mode (kernel) from user mode (processes) | |||
scheduler => enter user mode (processes) from supervisor mode (kernel) | |||
Scheduling algorithms | |||
Challenges of scheduling | |||
- maximize use of resources (throughput) | |||
- minimize wait time (latency) | |||
- minimal computational complexity | |||
scheduling is pure overhead | |||
- make sure "important" things get done | |||
- obey user preferences | |||
- do important system things | |||
Classic scheduling | |||
Batch scheduling | |||
- shortest job first | |||
- lowers latency for shorter jobs but isn't "fair" | |||
- first in, first out | |||
- fair, but can have bad consequences | |||
"time sharing" - preemptible scheduling | |||
- each process gets a "time slice" | |||
- when process is interupted, what to do next? | |||
key question | |||
- is it waiting for I/O? | |||
</pre> |
Latest revision as of 08:48, 23 November 2018
Video
The video from the lecture given on November 14, 2018 is now available.
Notes
What is dev/fuse How did i do a mount
Mount is a priveleged operation normally, it lets you shadow entire portions of the filesystem
fusermount breaks under strace
bin/fusermount is red because of the 's' permission bit.
What is the 's' permission bit? s stands for setuid in the owner position, and setgid in the group position. It allows a program to run with privileges different from the process that did the execve
Normally execve of a process will run as the user (the uid that is currently running)
setuid gives it the privileges of root instead
getuid() is who ran the process geteuid() is with what privelges is this process running normally these are equal, but it changes when you run setuid (same thing for gid)
If you run memoryll as root, the mnt point and all the files under it are exclusive to root One of the features of userspace mounting of filesystems, is that they are exclusive to the user that mounted them.
getattr() system calls writev and read, its a way of using multiple buffers mount - mounts dev/fuse and fd 3
In Class
Lecture 18 ---------- To Do ----- strace memoryll uid vs euid scheduling and __schedule Optional reading: https://utcc.utoronto.ca/~cks/space/blog/unix/RawTtyInputThenAndNow Scheduling ---------- System calls => enter supervisor mode (kernel) from user mode (processes) scheduler => enter user mode (processes) from supervisor mode (kernel) Scheduling algorithms Challenges of scheduling - maximize use of resources (throughput) - minimize wait time (latency) - minimal computational complexity scheduling is pure overhead - make sure "important" things get done - obey user preferences - do important system things Classic scheduling Batch scheduling - shortest job first - lowers latency for shorter jobs but isn't "fair" - first in, first out - fair, but can have bad consequences "time sharing" - preemptible scheduling - each process gets a "time slice" - when process is interupted, what to do next? key question - is it waiting for I/O?