The UNIX system has been in wide use for over 20 years, and has helped to define many areas of computing.
ok finally the hagiography ceases
4.4BSD kernel had 162,617 machine-independent lines of code, and 39,634 machine-dependent lines of code. that's 201,981 lines
Processes are scheduled for execution according to a process-priority parameter.
unimaginative
This priority is managed by a kernel-based scheduling algorithm.
oh so the kernel actually computes priority first and then it does a little min heap song and dance cool
Users can influence the scheduling of a process by specifying a parameter (nice) that weights the overall scheduling priority
insulting
oh curious so my sync context might be a good analogy to process groups
oooo
The entire contents of a process address space do not need to be resident for a process to execute.
i forgot that basically the only kinds of scheduling hints you can provide to the linux kernel are around your own address space
A process may, however, advise the system about expected future memory utilization as a performance aid.
complete joke! the better performance aid to the whole system would obviously be i/o ops!!!!
An interface was specified, called mmap(), that
allowed unrelated processes to request a shared mapping of a file into their address spaces. If multiple processes mapped the same file into their address spaces, changes to the file's portion of an address space by one process would be reflected in the area mapped by the other processes, as well as in the file itself.
yeah!!!!! if i explicitly ask for a shared mapping let me have it!!! don't do it for every goddamn file write lmao
The biggest incentives for memory mapping are the needs for accessing big files and for passing large quantities of data between processes.
yes. great. sharing is caring
Demands for dynamic memory allocation in the kernel have increased as more services have been added.
lmao
A generalized memory allocator reduces the
complexity of writing code inside the kernel.
i'm not sure if i like the idea of an unstructured allocator mechanism. what if all kernel pages had a job
oh shit physical memory isn't paged oh fuck that's so dangerous i could just start writing somewhere and no one would know
The basic model of the UNIX I/O system is a sequence of bytes that can be accessed either randomly or sequentially.
already this seems oversimplified. the "bytes" corresponding to mapped pages is really important
looking at their modern aio api https://man.freebsd.org/cgi/man.cgi?query=aio&sektion=3&manpath=NetBSD+9.1
Asynchronous I/O operations are not strictly sequential; operations are carried out in arbitrary order
ok, what about lio_listio, that looks promising https://man.freebsd.org/cgi/man.cgi?query=lio_listio&sektion=3&apropos=0&manpath=NetBSD+9.1
The order in which the requests are carried out is not specified, and there is no guarantee that they will be executed sequentially.
awesome
Different programs expect various levels of structure, but the kernel does not impose structure on I/O.
"impose" structure. yes it fucking does!!!! the structure it imposes is that of a time series of operations based on offset and length, expressed through the syscall interface
ROBERT PIKE JUMPSCARE
An I/O stream from one program can be fed as input to almost any other program.
see i hate this shit because if i want to feed an i/o stream like this the kernel still makes me allocate my own buffer then do a read/write loop. does this build character?