On Mon, 13 Sep 2004 01:54:33 -0400, Richard Ta-Min <2rtamin@xxxxxxxxx> wrote: > I have a question about the functioning of the linux swapper. I am > looking at kernel 2.4.26. I am also refering to the o'reilly book > "undestanding the linux kernel". See also Robert Love's "Linux Kernel Development" book and the excellent "Understanding the Linux Virtual Memory Manager" by Mel Gorman - both of these feature stuff on 2.6 aswell and are pretty fun reads (thanks guys). > The pages that store the page tables themselves (i.e the pages that > store the pgd, pmd and pte), are those pages ever swapped out ? No. The kernel is completely non-pageable at this moment in time - but that might well change in the future. It is certainly conceivable to allow pageing of page tables, especially on non-Intel architectures where one duplicates the functionality of the hardware page management in this Intelistic view of the world. On PowerPC[0] we have a hash table which the hardware consults for translations so we have an extra layer between the hardware and the kernel page tables that gets massaged (it's also quite sickeningly shocking to read the documentation for that - devised by twistedly evil minds of scary AIM engineers). > Or is it the case that only pages that contain data, code, stack, heap > etc... that are swapped out. Only user pages are swapped out because swapping most kernel pages results in a lot of extra complexity for little real gain - most people have ten times more RAM than they really need in their desktop, and those folks on embedded targets have enough to make do with a cutdown build. It would be nice to have this stuff if the implementation were clean. Cheers, Jon. [0] (in case anyone feels like beingly overly anally pedantic...) this only applies on hardware that implements or substantially follows the original PowerPC specification. So stuff like the IBM405 cores with soft TLB management don't actually enforce any particular page table structure since it's all completely done in software by loading up TLB tag and data entries. -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/