[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20220401070905.43679-1-linmiaohe@huawei.com>
Date: Fri, 1 Apr 2022 15:09:05 +0800
From: Miaohe Lin <linmiaohe@...wei.com>
To: <gregkh@...uxfoundation.org>
CC: <rafael@...nel.org>, <mel@....ul.ie>, <akpm@...ux-foundation.org>,
<minchan.kim@...il.com>, <kamezawa.hiroyu@...fujitsu.com>,
<kosaki.motohiro@...fujitsu.com>, <linux-kernel@...r.kernel.org>,
<linmiaohe@...wei.com>
Subject: [PATCH] drivers/base/node.c: fix compaction sysfs file leak
Compaction sysfs file is created via compaction_register_node in
register_node. But we forgot to remove it in unregister_node. Thus
compaction sysfs file is leaked. Using compaction_unregister_node
to fix this issue.
Fixes: ed4a6d7f0676 ("mm: compaction: add /sys trigger for per-node memory compaction")
Signed-off-by: Miaohe Lin <linmiaohe@...wei.com>
---
drivers/base/node.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/base/node.c b/drivers/base/node.c
index ec8bb24a5a22..0ac6376ef7a1 100644
--- a/drivers/base/node.c
+++ b/drivers/base/node.c
@@ -682,6 +682,7 @@ static int register_node(struct node *node, int num)
*/
void unregister_node(struct node *node)
{
+ compaction_unregister_node(node);
hugetlb_unregister_node(node); /* no-op, if memoryless node */
node_remove_accesses(node);
node_remove_caches(node);
--
2.23.0
Powered by blists - more mailing lists