Merge "mm/page_owner: ask users about default setting of PAGE_OWNER"

This commit is contained in:
qctecmdr 2019-10-12 02:19:46 -07:00 • committed by Gerrit - the friendly Code Review server
commit 2aca3e3aac
2 changed files with 16 additions and 1 deletions

View file

@ -72,6 +72,17 @@ config PAGE_OWNER
If unsure, say N.
config PAGE_OWNER_ENABLE_DEFAULT
bool "Enable Track page owner by default"
depends on PAGE_OWNER
help
This keeps track of what call chain is the owner of a page, may
help to find bare alloc_page(s) leaks. If you include this
feature on your build, it is enabled by default. You should pass
"page_owner=off" to boot parameter in order to disable it. Eats
a fair amount of memory if enabled. See tools/vm/page_owner_sort.c
for user-space helper.
config PAGE_POISONING
bool "Poison pages after freeing"
select PAGE_POISONING_NO_SANITY if HIBERNATION

View file

@ -29,7 +29,8 @@ struct page_owner {
#endif
};
static bool page_owner_disabled = true;
static bool page_owner_disabled =
!IS_ENABLED(CONFIG_PAGE_OWNER_ENABLE_DEFAULT);
DEFINE_STATIC_KEY_FALSE(page_owner_inited);
static depot_stack_handle_t dummy_handle;
@ -46,6 +47,9 @@ static int __init early_page_owner_param(char *buf)
if (strcmp(buf, "on") == 0)
page_owner_disabled = false;
if (strcmp(buf, "off") == 0)
page_owner_disabled = true;
return 0;
}
early_param("page_owner", early_page_owner_param);