On Wed, Oct 17, 2001 at 02:54:52AM -0000, Pichai Raghavan wrote: > > Hi All, > > I was looking at the vmalloc source code; looks like when vmalloc is called, the kernel calls get_free_pages which actually allocates physical pages and patches the PTE. This means that demand paging is not done for kernel virtual memory pages. Is there any specific reason why demand paging is turned off for kernel virtual memory? > > However on my MIPS machine, the basic TLB exception handler does not do any check if the TLB exception has happened for user or kernel; rather it takes care of doing demand paging for both user and kernel pages. Am I missing something here? > > Thanks > Raghav I'm not an expert on linux-specific VM, but I can see that paging kernel memory could lead to deadlock: what if you page out the data you need to page in other parts, or even page out data which you need to page it in itself back? Yes, you could mark some parts of kernel memory with some flag like "NEVER_EVER_SWAP_THIS_MEMORY", and if I recall correctly Multics could do something like that, but I suppose it's much simpler if you can assume that kernel memory is never swapped out. In fact, this could done as a way to force people to think better which parts need to be in-kernel and those which can be done in userspace and interact using a well-defined protocol to the kernel. Finally, maybe you can in fact ask for kernel-visible memory which is marked specifically as "ALLOWED_TO_SWAPOUT", but then also this memory could be non-usable in some cases such as an interrupt. Rik and other VM'ers, any light on this? -- every day, every year you have to work -- you have to study -- you have to scene wind^network - a network release in MMI - Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ IRC Channel: irc.openprojects.net / #kernelnewbies Web Page: http://www.kernelnewbies.org/