
Offering: HULK hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I9GSSR ---------------------------------------- This patch adds a new debugfs interface page_owner_module_show_max to allow users to configure how much modules are dumped when oom occurs. Signed-off-by: Jinjiang Tu <tujinjiang@huawei.com> --- mm/page_owner_module.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/mm/page_owner_module.c b/mm/page_owner_module.c index b64cfb4a1671..a8a3066b02d7 100644 --- a/mm/page_owner_module.c +++ b/mm/page_owner_module.c @@ -276,6 +276,21 @@ static struct notifier_block po_oom_nb = { .priority = 0 }; +static int po_module_topn_set(void *data, u64 val) +{ + po_module_topn = val; + return 0; +} + +static int po_module_topn_get(void *data, u64 *val) +{ + *val = po_module_topn; + return 0; +} + +DEFINE_SIMPLE_ATTRIBUTE(po_module_topn_fops, po_module_topn_get, + po_module_topn_set, "%llu\n"); + void po_module_stat_init(void) { int ret; @@ -293,4 +308,5 @@ void po_module_stat_init(void) if (ret) pr_warn("Failed to register page owner oom notifier\n"); + debugfs_create_file("page_owner_module_show_max", 0600, NULL, NULL, &po_module_topn_fops); } -- 2.25.1