WSL2-Linux-Kernel/ipc
Mel Gorman 5a6fe12595 Do not account for the address space used by hugetlbfs using VM_ACCOUNT
When overcommit is disabled, the core VM accounts for pages used by anonymous
shared, private mappings and special mappings. It keeps track of VMAs that
should be accounted for with VM_ACCOUNT and VMAs that never had a reserve
with VM_NORESERVE.

Overcommit for hugetlbfs is much riskier than overcommit for base pages
due to contiguity requirements. It avoids overcommiting on both shared and
private mappings using reservation counters that are checked and updated
during mmap(). This ensures (within limits) that hugepages exist in the
future when faults occurs or it is too easy to applications to be SIGKILLed.

As hugetlbfs makes its own reservations of a different unit to the base page
size, VM_ACCOUNT should never be set. Even if the units were correct, we would
double account for the usage in the core VM and hugetlbfs. VM_NORESERVE may
be set because an application can request no reserves be made for hugetlbfs
at the risk of getting killed later.

With commit fc8744adc8, VM_NORESERVE and
VM_ACCOUNT are getting unconditionally set for hugetlbfs-backed mappings. This
breaks the accounting for both the core VM and hugetlbfs, can trigger an
OOM storm when hugepage pools are too small lockups and corrupted counters
otherwise are used. This patch brings hugetlbfs more in line with how the
core VM treats VM_NORESERVE but prevents VM_ACCOUNT being set.

Signed-off-by: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-02-10 10:48:42 -08:00
..
Makefile ipc: recompute msgmni on ipc namespace creation/removal 2008-04-29 08:06:12 -07:00
compat.c fix logic error in ipc compat semctl() 2007-07-06 10:23:43 -07:00
compat_mq.c
ipc_sysctl.c ipc/ipc_sysctl.c: move the definition of ipc_auto_callback() 2009-01-06 15:59:29 -08:00
ipcns_notifier.c ipc: do not use a negative value to re-enable msgmni automatic recomputing 2008-07-25 10:53:42 -07:00
mqueue.c [CVE-2009-0029] System call wrappers part 26 2009-01-14 14:15:29 +01:00
msg.c [CVE-2009-0029] System call wrappers part 24 2009-01-14 14:15:28 +01:00
msgutil.c [PATCH] getting rid of all casts of k[cmz]alloc() calls 2006-12-13 09:05:58 -08:00
namespace.c ipc: recompute msgmni on ipc namespace creation/removal 2008-04-29 08:06:12 -07:00
sem.c [CVE-2009-0029] System call wrappers part 25 2009-01-14 14:15:28 +01:00
shm.c Do not account for the address space used by hugetlbfs using VM_ACCOUNT 2009-02-10 10:48:42 -08:00
util.c sanitize audit_ipc_set_perm() 2009-01-04 15:14:40 -05:00
util.h ipc: get rid of ipc_lock_down() 2008-07-25 10:53:42 -07:00