Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:__setup_per_zone_wmarks

Proto:static void __setup_per_zone_wmarks(void)

Type:void

Parameter:Nothing

7725  pages_min = min_free_kbytes >> PAGE_SHIFT determines the page size - 10
7726  lowmem_pages = 0
7732  If Not s_highmem - helper function to quickly check if a struct zone is a* highmem zone or not. This is an attempt to keep references* to ZONE_{DMA/NORMAL/HIGHMEM/etc} in general code to a minimum.*@zone - pointer to struct zone variable Then lowmem_pages += zone_managed_pages(zone)
7739  spin_lock_irqsave( & Primarily protects free_area , flags)
7740  tmp = pages_min * zone_managed_pages(zone)
7741  do_div() is NOT a C function(tmp, lowmem_pages)
7742  If s_highmem - helper function to quickly check if a struct zone is a* highmem zone or not. This is an attempt to keep references* to ZONE_{DMA/NORMAL/HIGHMEM/etc} in general code to a minimum.*@zone - pointer to struct zone variable Then
7754  min_pages = zone_managed_pages(zone) / 1024
7755  min_pages = clamp - return a value clamped to a given range with strict typechecking*@val: current value*@lo: lowest allowable value*@hi: highest allowable value* This macro does strict typechecking of @lo/@hi to make sure they are of the* same type as @val(min_pages, SWAP_CLUSTER_MAX, 128UL)
7756  zone watermarks, access with *_wmark_pages(zone) macros [WMARK_MIN] = min_pages
7757  Else
7762  zone watermarks, access with *_wmark_pages(zone) macros [WMARK_MIN] = tmp
7770  tmp = max_t - return maximum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(u64, tmp >> 2, Multiplies an integer by a fraction, while avoiding unnecessary* overflow or loss of precision.(zone_managed_pages(zone), watermark_scale_factor, 10000))
7774  zone watermarks, access with *_wmark_pages(zone) macros [WMARK_LOW] = min_wmark_pages(zone) + tmp
7775  zone watermarks, access with *_wmark_pages(zone) macros [WMARK_HIGH] = min_wmark_pages(zone) + tmp * 2
7776  watermark_boost = 0
7778  spin_unlock_irqrestore( & Primarily protects free_area , flags)
7782  alculate_totalreserve_pages - called when sysctl_lowmem_reserve_ratio* or min_free_kbytes changes.
Caller
NameDescribe
setup_per_zone_wmarkssetup_per_zone_wmarks - called when min_free_kbytes changes* or when memory is hot-{added|removed}* Ensures that the watermark[min,low,high] values for each zone are set* correctly with respect to min_free_kbytes.