Linux-MM
  • Comments
  • Immutable Page
  • Menu
    • Navigation
    • RecentChanges
    • FindPage
    • Local Site Map
    • Help
    • HelpContents
    • HelpOnMoinWikiSyntax
    • Display
    • Attachments
    • Info
    • Raw Text
    • Print View
    • Edit
    • Load
    • Save
  • Login

Linux Memory Management

  • Front Page

  • Documentation

  • Internals

  • Projects

  • Academic Research

References

  • LinuxKernelMailingLists

  • MemoryManagementLinks

Related sites

  • Kernel Newbies

  • Memory Management Forum

Wiki

  • Site Editors

  • Side Bar

  • Hosted by WikiWall

Navigation

  • RecentChanges
  • FindPage
  • HelpContents

Upload page content

You can upload content for the page named below. If you change the page name, you can also upload content for another page. If the page name is empty, we derive the page name from the file name.

File to load page content from
Page name
Comment

LinuxMM:
  • LinuxMMFAQ

What are the design internals behind zap_xxx_range() APIs?

Rik van Riel to Wu, kernelnewbies

On Sun, 30 Mar 2008 17:55:26 +0800 "Wu Yu" < vestige.lug@gmail.com > wrote:

> Hi all,

> AFAIK, for IA-32 arch, two-level paging is sufficient. But the

> positions of PUD and PMD are kept.

This is done so all architectures can use the same iterative functions, like unmap_page_range -> zap_pud_range -> zap_pmd_range -> zap_pte_range.

> I don't quite understand the word "mapping". Does that mean there > is one entry in PGD for both PUD and PMD?

It means that the kernel pretends that the pgd entry points to a pud (with one entry), even though it really points to a page table.

By pretenting it points to itself unmap_page_range can call the next function down, zap_pud_range.

We do the same thing in zap_pud_range - it calls zap_pmd_range on the same pgd entry, except now it thinks it points to a pmd.

Finally, zap_pmd_range interprets the entry and sees that it points to a page table. Zap_pmd_range invokes zap_pte_range and everything works as normal.

Because, on i386, we pretend that the PUD and PMD page tables only have 1 entry, the loop does not loop, but simply invokes the next function down once.

  • MoinMoin Powered
  • Python Powered
  • GPL licensed
  • Valid HTML 4.01