函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:__alloc_pages_may_oom

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

返回类型:struct page

参数:

类型参数名称
gfp_tgfp_mask
unsigned intorder
const struct alloc_context *ac
unsigned long *did_some_progress
3783  struct oom_control oc = {Used to determine cpuset = zonelist, Used to determine mempolicy = nodemask, Memory cgroup in which oom is invoked, or NULL for global oom = NULL, Used to determine cpuset and node locality requirement = gfp_mask, rder == -1 means the oom kill is required by sysrq, otherwise only* for display purposes. = order, }
3792  did_some_progress等于0
3798  如果非mutex_trylock - try to acquire the mutex, without waiting*@lock: the mutex to be acquired* Try to acquire the mutex atomically
3799  did_some_progress等于1
3800  schedule_timeout_uninterruptible(1)
3801  返回:NULL
3811  page等于get_page_from_freelist goes through the zonelist trying to allocate* a page.
3814  如果page则转到:out
3818  如果flags按位与Dumped core 则转到:out
3821  如果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.则转到:out
3829  如果gfp_mask按位与__GFP_RETRY_MAYFAIL则转到:out
3832  如果high_zoneidx小于标记为可直接映射的内核段的普通内存域则转到:out
3834  如果pm_suspended_storage()则转到:out
3847  如果gfp_mask按位与__GFP_THISNODE则转到:out
3851  如果_of_memory - kill the "best" process when we run out of memory*@oc: pointer to struct oom_control* If we run out of memory, we have the choice between either* killing a random task (bad), letting the system crash (worse)WARN_ON_ONCE(gfp_mask & __GFP_NOFAIL)则
3852  did_some_progress等于1
3858  如果gfp_mask按位与__GFP_NOFAILpage等于__alloc_pages_cpuset_fallback(gfp_mask, order, don't check watermarks at all , ac)
3862  out :
3863  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
3864  返回:page
调用者
名称描述
__alloc_pages_slowpath