Linux Swapper and process page tables

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

 



Hello,

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

>From what I undestand, when the system runs low on physical memory,
linux goes through the page table of user processes and swaps out some
pages to the swap cache which are then periodically flushed to disk
(swap partition)

My question is the following: 
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 ? Or is
it the case that only pages that contain data, code, stack, heap
etc... that are swapped out.

The top level swapping function is swap_out().
For each user process swap_out() invokes swap_out_mm() on the memory
descriptor mm_struct of the process. swap_out_mm() then calls
swap_out_vma() on each memory region of the process. From there some
pages of some memory regions are swapped out. So from that I would
think that only pages that are part of a process's memory region are
swapped out. Since pages that store the page table themselves are not
part of any memory region then I would think that those pages are
never swapped out. It would be great if someone could confirm that I
am right or wrong.

Thank You
Richard

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[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