4

I think page tables is maintained by Linux kernel, so the memory need for page tables should not be swapped out, for the reason that the kernel do not have page fault thing. But, if the pgd, pmd, pte tables are all in main memory and never swapped out, the meaning of multilevel paging can not save any memory.

So I am confused about the how page tables themselves are managed.

Ziyu Chen
  • 43
  • 4
  • Possible duplicate: https://stackoverflow.com/questions/24322135/how-page-tables-are-stored-in-the-main-memory – Michaël Aug 04 '20 at 16:08

1 Answers1

1

well, according to wikipedia, it is true that page tables aren't swapped out - but swapping out tables isn't what makes them memory efficient! lets take an example: our physical memory is 4GB in size, every page is 4KB so we would have needed 4MB size table in order to map every address. the solution to this problem isn't swapping out part of the table, but creating a hierarchy of tables, so you can allocate only the parts in the hierarchy which you need. it is explained quite thoroughly here: Why using hierarchical page tables?

Community
  • 1
  • 1
Michal Cohen
  • 11
  • 1
  • 2