函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:__setup_per_zone_wmarks

函数原型:static void __setup_per_zone_wmarks(void)

返回类型:void

参数:

7725  pages_min等于min_free_kbytes右移PAGE_SHIFT determines the page size 减10位
7726  lowmem_pages等于0
7732  如果非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 variablelowmem_pages加等于zone_managed_pages(zone)
7739  spin_lock_irqsave( & 自旋锁, flags)
7740  tmp等于pages_minzone_managed_pages(zone)
7741  do_div() is NOT a C function(tmp, lowmem_pages)
7742  如果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
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  否则
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( & 自旋锁, flags)
7782  alculate_totalreserve_pages - called when sysctl_lowmem_reserve_ratio* or min_free_kbytes changes.
调用者
名称描述
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.