diff options
author | Miaohe Lin <linmiaohe@huawei.com> | 2022-04-29 09:16:06 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-06-14 19:11:41 +0300 |
commit | 386e69e068177ee91cac27f2f0e6ebda1515f5ca (patch) | |
tree | c1f85f7121189ea8f475a7ef8bf487f7ba6cd6b5 /drivers | |
parent | d1f908bd0100f939b4e4a5b4d87b77db90f6b806 (diff) | |
download | linux-386e69e068177ee91cac27f2f0e6ebda1515f5ca.tar.xz |
drivers/base/node.c: fix compaction sysfs file leak
[ Upstream commit da63dc84befaa9e6079a0bc363ff0eaa975f9073 ]
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.
Link: https://lkml.kernel.org/r/20220401070905.43679-1-linmiaohe@huawei.com
Fixes: ed4a6d7f0676 ("mm: compaction: add /sys trigger for per-node memory compaction")
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Rafael J. Wysocki <rafael@kernel.org>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Minchan Kim <minchan.kim@gmail.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/base/node.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/base/node.c b/drivers/base/node.c index 62a052990bb9..666eb55c0774 100644 --- a/drivers/base/node.c +++ b/drivers/base/node.c @@ -641,6 +641,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); |