|
|
About
TODO
Blog
RSS
Old blog
Projects
Gallery
Notes
Fri, 19 Jan 2007
Userspce scheduling in M-on-N threading model.
The main purpose of the scheduler as a saparated system is to
hold fairness in spreading CPU clocks between tasks.
Current scheduler just gets next task and gives it its own timeslice (currently equal to 10 milliseconds).
If that task is sleeping in syscall or performing CPU intensive operations,
system will not take that into account.
So tasks which are so called IO-bound,
i.e. waiting in syscall for IO comlpetion (or actually any other sleeping),
are not getting CPU clocks in a fair manner, since theirs timeslices
are spent mostly sleeping. CPU-bound tasks in that model does not fully utilize
CPU too, since part of the time CPU is idle since scheduler put IO-bound
task into execution, and that task is waiting, while it would be possible to
start CPU-bound task.
So, the solution is to provide each task a given timeslice, which
will be decreased when task is actively executed on CPU. If task
puts itself into sleep, its timeslice is reduced according to time,
which was used for active execution. When rescheduling happens
either in syscall time or in a signal, scheduler will select
task with the highest timeslice left. Priority of the task will
correspond to the length of the timeslice each task obtains.
Userspace scheduler also has access to the information, what exactly any task in question
is doing, so if it is known that it is waiting in syscall, it will not be awakened
at all until scheduler receives kevent which given task is waiting for.
/devel/threading :: Link / Comments (0)
Kevent feature request for aio_sendfile().
Suparna Bhattacharya (IBM) has requested new feature in the asynchronous
file sending syscall - header pointer, which will be put into socket
queue before file's data.
Although Linux syscall overhead is extremely small compared to other Unix
systems, it is still not zero, so since I already "optimized" (i.e. removed)
open() call in aio_sendfile_path(), I think
things will not became worse if I will put there header pointer and length
too.
I plan to release new kevent version after
M-on-N threading model implementation
with this feature implemented.
/devel/kevent :: Link / Comments (0)
Brilliant idea on how to break Linux networking code completely.
I'm going to substitute sockets with netchannels,
but with having backward compatibility - mainly I will replace socket lookup hash tables
with netchannel's trie and will make socket as special type of netchannels,
like netfilter or userspace netchannels currently.
This change is completely transparent to all users, since no API will be changed,
only socket allocation/lookup/freeing.
This change us intended to allow unlimited scaling of number of sockets with
constant search time (since there is only one type of wildcards sockets - listening
ones, which expect incoming connection from 0.0.0.0 address, there will be
only one wildcard per trie, thus searching time will be constant).
I've put this item into
TODO and schedule this changes after
M-on-N threading model implementation.
/devel/networking :: Link / Comments (0)
|