函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:__alloc_pages_slowpath

函数原型:static inline struct page *__alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order, struct alloc_context *ac)

返回类型:struct page

参数:

类型参数名称
gfp_tgfp_mask
unsigned intorder
struct alloc_context *ac
4393  can_direct_reclaim等于gfp_mask按位与Caller can reclaim
4394  costly_order等于order大于PAGE_ALLOC_COSTLY_ORDER is the order at which allocations are deemed* costly to service. That is between allocation orders which should* coalesce naturally under reasonable reclaim pressure and those which* will not.
4395  struct page * page = NULL
4409  如果WARN_ON_ONCE((gfp_mask & (DOC: Watermark modifiers* Watermark modifiers -- controls access to emergency reserves* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~* %__GFP_HIGH indicates that the caller is high-priority and that granting | Caller can reclaim )) == (DOC: Watermark modifiers* Watermark modifiers -- controls access to emergency reserves* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~* %__GFP_HIGH indicates that the caller is high-priority and that granting | Caller can reclaim ))则gfp_mask与等于DOC: Watermark modifiers* Watermark modifiers -- controls access to emergency reserves* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~* %__GFP_HIGH indicates that the caller is high-priority and that granting的反
4413  retry_cpuset :
4414  compaction_retries等于0
4415  no_progress_loops等于0
4416  compact_priority等于DEF_COMPACT_PRIORITY
4417  cpuset_mems_cookie等于read_mems_allowed_begin()
4424  alloc_flags等于gfp_to_alloc_flags(gfp_mask)
4432  preferred_zoneref等于 - Zoneref pointer for the first suitable zone found (see below)
4434  如果非Pointer to actual zone 则转到:nopage
4437  如果alloc_flags按位与allow waking of kswapd wake_all_kswapds(order, gfp_mask, ac)
4444  page等于get_page_from_freelist goes through the zonelist trying to allocate* a page.
4445  如果page则转到:got_pg
4457  如果can_direct_reclaimcostly_orderorder大于0且migratetype不等于MIGRATE_MOVABLE的值且非gfp_pfmemalloc_allowed(gfp_mask)则
4461  page等于__alloc_pages_direct_compact(gfp_mask, order, alloc_flags, ac, INIT_COMPACT_PRIORITY, & compact_result)
4465  如果page则转到:got_pg
4472  如果costly_ordergfp_mask按位与__GFP_NORETRY
4490  如果compact_result恒等于COMPACT_SKIPPEDcompact_result恒等于COMPACT_DEFERRED则转到:nopage
4503  retry :
4505  如果alloc_flags按位与allow waking of kswapd wake_all_kswapds(order, gfp_mask, ac)
4508  reserve_flags等于Distinguish requests which really need access to full memory* reserves from oom victims which can live with a portion of it
4509  如果reserve_flagsalloc_flags等于reserve_flags
4517  如果非alloc_flags按位与check for correct cpuset 的值或reserve_flags
4518  nodemask = NULL
4519  preferred_zoneref等于 - Zoneref pointer for the first suitable zone found (see below)
4524  page等于get_page_from_freelist goes through the zonelist trying to allocate* a page.
4525  如果page则转到:got_pg
4529  如果非can_direct_reclaim则转到:nopage
4533  如果flags按位与Allocating memory 则转到:nopage
4537  page等于The really slow allocator path where we enter direct reclaim
4539  如果page则转到:got_pg
4543  page等于__alloc_pages_direct_compact(gfp_mask, order, alloc_flags, ac, compact_priority, & compact_result)
4545  如果page则转到:got_pg
4549  如果gfp_mask按位与__GFP_NORETRY则转到:nopage
4556  如果costly_order且非gfp_mask按位与__GFP_RETRY_MAYFAIL的值则转到:nopage
4559  如果Checks whether it makes sense to retry the reclaim to make a forward progress* for the given allocation request.* We give up when we either have tried MAX_RECLAIM_RETRIES in a row* without success, or when we couldn't even meet the watermark if we则转到:retry
4569  如果did_some_progress大于0且should_compact_retry(ac, order, alloc_flags, compact_result, & compact_priority, & compaction_retries)则转到:retry
4577  如果check_retry_cpuset(cpuset_mems_cookie, ac)则转到:retry_cpuset
4581  page等于__alloc_pages_may_oom(gfp_mask, order, ac, & did_some_progress)
4582  如果page则转到:got_pg
4586  如果tsk_is_oom_victim(当前进程)且alloc_flags恒等于Only MMU archs have async oom victim reclaim - aka oom_reaper so we* cannot assume a reduced access to memory reserves is sufficient for* !MMUgfp_mask按位与__GFP_NOMEMALLOC的值则转到:nopage
4592  如果did_some_progress
4593  no_progress_loops等于0
4594  转到:retry
4597  nopage :
4599  如果check_retry_cpuset(cpuset_mems_cookie, ac)则转到:retry_cpuset
4606  如果gfp_mask按位与__GFP_NOFAIL
4611  如果WARN_ON_ONCE(!can_direct_reclaim)则转到:fail
4619  WARN_ON_ONCE(flags & Allocating memory )
4627  WARN_ON_ONCE(order > PAGE_ALLOC_COSTLY_ORDER is the order at which allocations are deemed* costly to service. That is between allocation orders which should* coalesce naturally under reasonable reclaim pressure and those which* will not.)
4635  page等于__alloc_pages_cpuset_fallback(gfp_mask, order, ry to alloc harder , ac)
4636  如果page则转到:got_pg
4639  cond_resched()
4640  转到:retry
4642  fail :
4643  warn_alloc(gfp_mask, nodemask, "page allocation failure: order:%u", order)
4645  got_pg :
4646  返回:page
调用者
名称描述
__alloc_pages_nodemaskThis is the 'heart' of the zoned buddy allocator.