Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Reinititalise user and admin reserves if memory is added or removed

Proto:static int reserve_mem_notifier(struct notifier_block *nb, unsigned long action, void *data)

Type:int

Parameter:

TypeParameterName
struct notifier_block *nb
unsigned longaction
void *data
3702  Case action == xposed to userspace
3704  tmp = sysctl_user_reserve_kbytes
3705  If 0 < tmp && tmp < 1UL << 17 Then Initialise sysctl_user_reserve_kbytes.* This is intended to prevent a user from starting a single memory hogging* process, such that they cannot recover (kill the hog) in OVERCOMMIT_NEVER* mode.* The default value is min(3% of free memory, 128MB)
3709  tmp = sysctl_admin_reserve_kbytes
3710  If 0 < tmp && tmp < 1UL << 13 Then Initialise sysctl_admin_reserve_kbytes.* The purpose of sysctl_admin_reserve_kbytes is to allow the sys admin* to log in and kill a memory hogging process.* Systems with more than 256MB will reserve 8MB, enough to recover
3713  Break
3714  Case action == xposed to userspace
3715  free_kbytes = global_zone_page_state( First 128 byte cacheline (assuming 64 bit words) ) << PAGE_SHIFT determines the page size - 10
3719  pr_info("vm.user_reserve_kbytes reset to %lu\n", sysctl_user_reserve_kbytes)
3725  pr_info("vm.admin_reserve_kbytes reset to %lu\n", sysctl_admin_reserve_kbytes)
3728  Break
3729  Default
3730  Break
3732  Return Suits me