Page mobility and placement

The following code snippet defines page mobility and placement flags:

#define __GFP_RECLAIMABLE ((__force gfp_t)___GFP_RECLAIMABLE)
#define __GFP_WRITE ((__force gfp_t)___GFP_WRITE)
#define __GFP_HARDWALL ((__force gfp_t)___GFP_HARDWALL)
#define __GFP_THISNODE ((__force gfp_t)___GFP_THISNODE)
#define __GFP_ACCOUNT ((__force gfp_t)___GFP_ACCOUNT)

Following is a list of page mobility and placement flags:

  • __GFP_RECLAIMABLE: Most kernel subsystems are designed to engage memory caches for caching frequently needed resources such as data structures, memory blocks, persistent file data, and so on. The memory manager maintains such caches and allows them to dynamically expand on demand. However, such caches cannot be allowed to expand boundlessly, or they will eventually consume all memory. The memory manager handles this issue through the shrinker interface, a mechanism by which the memory manager can shrink a cache, and reclaim pages when needed. Enabling this flag while allocating pages (for the cache) is an indication to the shrinker that the page is reclaimable. This flag is used by the slab allocator, which is discussed in a later section.
  • __GFP_WRITE: When this flag is used, it indicates to the kernel that the caller intends to dirty the page. The memory manager allocates the appropriate page as per the fair-zone allocation policy, which round-robins the allocation of such pages across local zones of the node to avoid all the dirty pages being in one zone.
  • __GFP_HARDWALL: This flag ensures that allocation is carried out on same node or nodes to which the caller is bound; in other words, it enforces the CPUSET memory allocation policy.
  • __GFP_THISNODE: This flag forces the allocation to be satisfied from the requested node with no fallbacks or placement policy enforcements.
  • __GFP_ACCOUNT: This flag causes allocations to be accounted for the kmem control group.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.22.181.81