switching tasks …

… takes time, some paper i read mentioned between 3 and 5 percent overhead for a 1000Hz tick on a new chip –
why not run the whole scheduler in L2 or L3 cache, in a protected area – 1 or 2 MB would do the trick?
switching tasks could be done in a few cycles, and even within the time it takes to get a byte from the disk – or even a page fromĀ  RAM (filling a cache line)

i always feel like my CPU is bored and useless whenever i hear the disks rattle!

PS i know there are microkernels, but AFAIK they are ‘normal’ pieces of code, very compact, but they can be thrown out of the L1/L2 cache when needed. my thinking is there;s gotta be a protected area inside where 1-2 MB reside and run the task scheduling with almost no swapping or overhead

the catch with virtual machines is that (at least) a hundred times a second everything gets thrown out and a new task ‘moves in’ … ok that’ll be only a few percent of the whole CPU time, but what if you could switch seamless whenever one CPU is waiting e.g. for memory swapping (a whole 4k page!) or even worse, diskĀ  I/O

Intels approach now is that they started integration mem controllers in the CPU (a few years after AMD), but they work in parallel, and the mem is not managed (or has no affinity with a certain task), so everything gets scrambled around anyways!