mm: Never allow allocations more than our physical memory

This should provide faster allocations than OVERCOMMIT_GUESS, without
the significant OOM risk of OVERCOMMIT_ALWAYS.

Signed-off-by: Tyler Nijmeh <tylernij@gmail.com>
This commit is contained in:
Tyler Nijmeh
2020-07-11 16:50:29 +00:00
committed by DhineshCool
parent 2ae95c14b1
commit 1eaff7a60f

View File

@@ -532,8 +532,8 @@ int __page_mapcount(struct page *page)
}
EXPORT_SYMBOL_GPL(__page_mapcount);
int sysctl_overcommit_memory __read_mostly = OVERCOMMIT_GUESS;
int sysctl_overcommit_ratio __read_mostly = 50;
int sysctl_overcommit_memory __read_mostly = OVERCOMMIT_NEVER;
int sysctl_overcommit_ratio __read_mostly = 100;
unsigned long sysctl_overcommit_kbytes __read_mostly;
int sysctl_max_map_count __read_mostly = DEFAULT_MAX_MAP_COUNT;
unsigned long sysctl_user_reserve_kbytes __read_mostly = 1UL << 17; /* 128MB */