Re: demand paging of vmalloced memory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 17 Oct 2001, wind^ntw wrote:
> On Wed, Oct 17, 2001 at 02:54:52AM -0000, Pichai Raghavan wrote:

> > 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?

> 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?

Indeed, the kernel loads device drivers into vmalloc space
and some device drivers put their data in vmalloc space.

It would be rather embarrassing (sp?) if the kernel swapped
out part of the SCSI device driver and later wasn't able to
swap it back in because thing it swapped out is the part of
the device driver it needs to swap it back in ... ;)

> 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.

Exactly, not swapping kernel memory is so much simpler that
the complexity and space saved by that assumption are probably
as large as the amount of kernel memory we could save by swapping
it out ;)

regards,

Rik
-- 
DMCA, SSSCA, W3C?  Who cares?  http://thefreeworld.net/  (volunteers needed)

http://www.surriel.com/		http://distro.conectiva.com/

-
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/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux