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:
  • SwapEntryRepresentation

A swap entry has two parts, one called the type (stored in an unsigned long), and one called the offset (stored in a data structure called a pgoff_t). The type is the swap area (partition or file) to use (there can be up to 32), the offset is the number of page sized (4kb) chunks to count from the beginning of the type. They’re both stored in a swap_entry_ t, which is an unsigned long stored inside a struct for protection. A swap_entry_t is created and manipulated through functions that live in include/linux/swapops.h. There is, for instance,

  • swp_entry() which takes a type and offset and returns a newly created swap_entry_t
  • swp_type() and swp_offset() which take a swp_entry_t and return the extracted type (unsigned long) and a pgoff_t, respectively
  • swp_entry_to_pte(), which takes a swap_entry_t and converts it into its corresponding and analogous page table entry, i.e. pte_t
  • MoinMoin Powered
  • Python Powered
  • GPL licensed
  • Valid HTML 4.01