Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:prepare_alloc_pages

Proto:static inline bool prepare_alloc_pages(gfp_t gfp_mask, unsigned int order, int preferred_nid, nodemask_t *nodemask, struct alloc_context *ac, gfp_t *alloc_mask, unsigned int *alloc_flags)

Type:bool

Parameter:

TypeParameterName
gfp_tgfp_mask
unsigned intorder
intpreferred_nid
nodemask_t *nodemask
struct alloc_context *ac
gfp_t *alloc_mask
unsigned int *alloc_flags
4654  high_zoneidx = gfp_zone(gfp_mask)
4655  zonelist = We get the zone list from the current node and the gfp_mask.* This zone list contains a maximum of MAXNODES*MAX_NR_ZONES zones.* There are two zonelists per node, one for all zones with memory and
4656  nodemask = nodemask
4657  migratetype = gfpflags_to_migratetype(gfp_mask)
4659  If cpusets_enabled() Then
4660  alloc_mask |= __GFP_HARDWALL
4661  If Not nodemask Then nodemask = cpuset_current_mems_allowed
4663  Else alloc_flags |= check for correct cpuset
4667  fs_reclaim_acquire(gfp_mask)
4668  fs_reclaim_release(gfp_mask)
4670  might_sleep_if(gfp_mask & Caller can reclaim )
4672  If should_fail_alloc_page(gfp_mask, order) Then Return false
4675  If IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_CMA) && migratetype == MIGRATE_MOVABLE Then alloc_flags |= allow allocations from CMA areas
4678  Return true
Caller
NameDescribe
__alloc_pages_nodemaskThis is the 'heart' of the zoned buddy allocator.