函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\page_alloc.c Create Date:2022-07-27 16:36:12
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:prepare_alloc_pages

函数原型: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)

返回类型:bool

参数:

类型参数名称
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  如果cpusets_enabled()则
4660  alloc_mask或等于__GFP_HARDWALL
4661  如果非nodemasknodemask等于cpuset_current_mems_allowed
4663  否则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  如果should_fail_alloc_page(gfp_mask, order)则返回:false
4675  如果IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_CMA)且migratetype恒等于MIGRATE_MOVABLEalloc_flags或等于allow allocations from CMA areas
4678  返回:true
调用者
名称描述
__alloc_pages_nodemaskThis is the 'heart' of the zoned buddy allocator.