Skip to main content
2 of 6
deleted 1 character in body
sourcejedi
  • 53.6k
  • 23
  • 179
  • 337

PTE's represent virtual pages. As you say, when a virtual page is present in main memory, the PTE's address field will hold the physical Page Frame Number (PFN).

Each physical page has a corresponding struct page. This has:

Following flags is:

struct address_space *mapping; 

For pages that are in the page cache (a large portion of the pages on most systems), mapping points to the information needed to access the file that backs up the page. If, however, the page is an anonymous page (user-space memory backed by swap), then mapping will point to an anon_vma structure [...]

-- Cramming more into struct page, LWN.net

Then, the page→index field is used to store the swp_entry_t structure for anonymous pages. (For pages in the page cache, this holds a file offset).

-- Rephrased from Understanding the Linux Virtual Memory Manager, Mel Gorman, 2004.

sourcejedi
  • 53.6k
  • 23
  • 179
  • 337