Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:__alloc_pages_may_oom

Proto: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)

Type:struct page

Parameter:

TypeParameterName
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  If Not mutex_trylock - try to acquire the mutex, without waiting*@lock: the mutex to be acquired* Try to acquire the mutex atomically Then
3799  did_some_progress = 1
3800  schedule_timeout_uninterruptible(1)
3801  Return NULL
3811  page = get_page_from_freelist goes through the zonelist trying to allocate* a page.
3814  If page Then Go to out
3818  If flags & Dumped core Then Go to out
3821  If 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. Then Go to out
3829  If gfp_mask & __GFP_RETRY_MAYFAIL Then Go to out
3832  If high_zoneidx < * Normal addressable memory is in ZONE_NORMAL. DMA operations can be * performed on pages in ZONE_NORMAL if the DMA devices support * transfers to all addressable memory. Then Go to out
3834  If pm_suspended_storage() Then Go to out
3847  If gfp_mask & __GFP_THISNODE Then Go to out
3851  If _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) Then
3852  did_some_progress = 1
3858  If gfp_mask & __GFP_NOFAIL Then page = __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  Return page
Caller
NameDescribe
__alloc_pages_slowpath