函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:get_page_from_freelist goes through the zonelist trying to allocate* a page.

函数原型:static struct page *get_page_from_freelist(gfp_t gfp_mask, unsigned int order, int alloc_flags, const struct alloc_context *ac)

返回类型:struct page

参数:

类型参数名称
gfp_tgfp_mask
unsigned intorder
intalloc_flags
const struct alloc_context *ac
3574  struct pglist_data * last_pgdat_dirty_limit = NULL
3577  retry :
3582  no_fallback等于alloc_flags按位与ALLOC_NOFRAGMENT
3583  z等于preferred_zoneref
3589  如果cpusets_enabled()且alloc_flags按位与check for correct cpuset 且非__cpuset_zone_allowed(zone, gfp_mask)则继续下一循环
3612  如果spread_dirty_pages
3613  如果last_pgdat_dirty_limit恒等于建立内存域和父结点之间的关联则继续下一循环
3618  继续下一循环
3622  如果no_fallbacknr_online_nodes大于1且zone不等于Pointer to actual zone
3631  local_nid等于zone_to_nid(Pointer to actual zone )
3632  如果zone_to_nid(zone)不等于local_nid
3633  alloc_flags与等于ALLOC_NOFRAGMENT的反
3634  转到:retry
3638  mark等于wmark_pages(zone, alloc_flags & Mask to get the watermark bits )
3639  如果非zone_watermark_fast(zone, order, mark, ac_classzone_idx(ac), alloc_flags)则
3654  BUILD_BUG_ON - break compile if a condition is true(don't check watermarks at all < NR_WMARK)
3655  如果alloc_flags按位与don't check watermarks at all 则转到:try_this_zone
3658  如果Node reclaim mode* If non-zero call node_reclaim when the number of free pages falls below* the watermarks.恒等于0或非zone_allows_reclaim(Pointer to actual zone , zone)则继续下一循环
3662  ret等于node_reclaim(建立内存域和父结点之间的关联, gfp_mask, order)
3664  :ret恒等于NODE_RECLAIM_NOSCAN
3666  继续下一循环
3667  :ret恒等于NODE_RECLAIM_FULL
3669  继续下一循环
3670  默认
3676  继续下一循环
3680  try_this_zone :
3681  page等于Allocate a page from the given zone. Use pcplists for order-0 allocations.
3683  如果page
3684  prep_new_page(page, order, gfp_mask, alloc_flags)
3690  如果此条件成立可能性小(为编译器优化)(order && (alloc_flags & ry to alloc harder ))则Reserve a pageblock for exclusive use of high-order atomic allocations if* there are no empty page blocks that contain a page with a suitable order
3693  返回:page
3694  否则
3709  如果no_fallback
3710  alloc_flags与等于ALLOC_NOFRAGMENT的反
3711  转到:retry
3714  返回:NULL
调用者
名称描述
__alloc_pages_cpuset_fallback
__alloc_pages_may_oom
__alloc_pages_direct_reclaimThe really slow allocator path where we enter direct reclaim
__alloc_pages_slowpath
__alloc_pages_nodemaskThis is the 'heart' of the zoned buddy allocator.