Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Return true if free base pages are above 'mark'. For high-order checks it* will return true of the order-0 watermark is reached and there is at least* one free page of a suitable size. Checking now avoids taking the zone lock

Proto:bool __zone_watermark_ok(struct zone *z, unsigned int order, unsigned long mark, int classzone_idx, unsigned int alloc_flags, long free_pages)

Type:bool

Parameter:

TypeParameterName
struct zone *z
unsigned intorder
unsigned longmark
intclasszone_idx
unsigned intalloc_flags
longfree_pages
3394  min = mark
3396  alloc_harder = alloc_flags & (ry to alloc harder | Only MMU archs have async oom victim reclaim - aka oom_reaper so we* cannot assume a reduced access to memory reserves is sufficient for* !MMU)
3399  free_pages -= (1 << order) - 1
3401  If alloc_flags & __GFP_HIGH set Then min -= min / 2
3409  If Value is more likely to compile time(!alloc_harder) Then
3410  free_pages -= nr_reserved_highatomic
3411  Else
3418  If 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* !MMU Then min -= min / 2
3420  Else min -= min / 4
3427  If Not (alloc_flags & allow allocations from CMA areas ) Then free_pages -= zone_page_state(z, NR_FREE_CMA_PAGES)
3436  If free_pages <= min + * We don't know if the memory that we're going to allocate will be * freeable or/and it will be released eventually, so to avoid totally * wasting several GB of ram we must reserve some of the lower zone * memory (otherwise we risk to run OOM on the lower [classzone_idx] Then Return false
3440  If Not order Then Return true
3444  When o < Free memory management - zoned buddy allocator. cycle
3445  area = Write-intensive fields used from the page allocator [o]
3448  If Not nr_free Then Continue
3451  When mt < MIGRATE_PCPTYPES cycle
3452  If Not free_area_empty(area, mt) Then Return true
3459  Return true
3462  If alloc_harder && Not list_empty - tests whether a list is empty*@head: the list to test. Then Return true
3466  Return false
Caller
NameDescribe
zone_watermark_ok
zone_watermark_fast
zone_watermark_ok_safe
should_reclaim_retryChecks 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