Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\page_alloc.c Create Date:2022-07-28 15:06:10
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:This is the 'heart' of the zoned buddy allocator.

Proto:struct page *__alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order, int preferred_nid, nodemask_t *nodemask)

Type:struct page

Parameter:

TypeParameterName
gfp_tgfp_mask
unsigned intorder
intpreferred_nid
nodemask_t *nodemask
4704  alloc_flags = ALLOC_WMARK_LOW
4706  struct alloc_context ac = {}
4712  If Value for the false possibility is greater at compile time(order >= Free memory management - zoned buddy allocator. ) Then
4713  WARN_ON_ONCE(!(gfp_mask & DOC: Action modifiers* Action modifiers* ~~~~~~~~~~~~~~~~* %__GFP_NOWARN suppresses allocation failure reports.* %__GFP_COMP address compound page metadata.* %__GFP_ZERO returns a zeroed page on success.))
4714  Return NULL
4717  gfp_mask &= gfp_allowed_mask
4718  alloc_mask = gfp_mask
4719  If Not prepare_alloc_pages(gfp_mask, order, preferred_nid, nodemask, & ac, & alloc_mask, & alloc_flags) Then Return NULL
4722  Determine whether to spread dirty pages and what the first usable zone
4728  alloc_flags |= The restriction on ZONE_DMA32 as being a suitable zone to use to avoid* fragmentation is subtle. If the preferred zone was HIGHMEM then* premature use of a lower zone may cause lowmem pressure problems that* are worse than fragmentation
4731  page = get_page_from_freelist goes through the zonelist trying to allocate* a page.
4732  If Value is more likely to compile time(page) Then Go to out
4741  alloc_mask = Applies per-task gfp context to the given allocation flags.* PF_MEMALLOC_NOIO implies GFP_NOIO* PF_MEMALLOC_NOFS implies GFP_NOFS* PF_MEMALLOC_NOCMA implies no allocation from CMA region.
4742  spread_dirty_pages = false
4748  If Value for the false possibility is greater at compile time(nodemask != nodemask) Then nodemask = nodemask
4751  page = __alloc_pages_slowpath(alloc_mask, order, & ac)
4753  out :
4754  If memcg_kmem_enabled() && gfp_mask & __GFP_ACCOUNT && page && Value for the false possibility is greater at compile time(__memcg_kmem_charge(page, gfp_mask, order) != 0) Then
4756  __free_pages(page, order)
4757  page = NULL
4760  trace_mm_page_alloc(page, order, alloc_mask, migratetype)
4762  Return page
Caller
NameDescribe
alloc_buddy_huge_page
alloc_pages_vmaalloc_pages_vma - Allocate a page for a VMA.*@gfp:* %GFP_USER user allocation.* %GFP_KERNEL kernel allocations,* %GFP_HIGHMEM highmem/user allocations,* %GFP_FS allocation should not call back into a file system.* %GFP_ATOMIC don't sleep.
alloc_pages_currentalloc_pages_current - Allocate pages.*@gfp:* %GFP_USER user allocation,* %GFP_KERNEL kernel allocation,* %GFP_HIGHMEM highmem allocation,* %GFP_FS don't call back into a file system.* %GFP_ATOMIC don't sleep.
new_page_nodemask