Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp447139iog; Mon, 13 Jun 2022 06:09:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvl2na8ITtKzTYwpeEvWhzDTQ7S+tUXwYEVKaAydxyQHbH9ioc8qlj+1Uf1nTrKx+Vsm10 X-Received: by 2002:a63:5304:0:b0:3db:2e57:6f34 with SMTP id h4-20020a635304000000b003db2e576f34mr51843799pgb.88.1655125343037; Mon, 13 Jun 2022 06:02:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655125343; cv=none; d=google.com; s=arc-20160816; b=xZkz+4iBGD0PBc6M8zBLmfeIf+hFBynIim+AuEIhEis+zbikCY7reaXGR/qxTJfwR0 cSUS0vvtTnZRdAx0ofSzKQJe3ZWIe1dnZKVWDMFUx+PyNo+3SUVWLFJgAfbH0/mzxhcI e3vjbRTb2Q08fJxsn65ZDN4lnyRZAWY+eF/mH4ULpH2VYrhQcerG+egR+Z7C1Cie2oDW 3LKQMbXb8Odq6FNrICCA8COauqypLjK3TDU0dkbPWKqq/VHKQ3kLzvKJ9Pe0+F2hrw3b CL6SQ1X1bYvG/fkKlt6B3Ob4LKfQc+GnTHKL5Ain3XJQUXmzzNs7sSwINFk4D0Qh4cYw vL3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=n/PYbQkKRqFF5eDYrqK6kjDlMDi4SpsWUynBBlS96hs=; b=RZwuJA2X0a2vIYl1zIhcSfcY/UUQBOwXepB7jCfG6fn42l68QoEf2HjL1KPNuhDJpP jJQoxVwcB7bkjHVPvOtV5mnSPgXBhqCsq5caXlapj3bxSEIaz1JJt5N27y8nMB1UAt5H 99n/fEbZYsIbGBdaXcitil1aRDBOp+QnK0fVJ7pgYBtYgqsU/++TljgvaMjUabOLXkGV EXaZQ9FFNj8ZT8OqjJ8sxziU8fVDNHjz/3GIYIESEcLRDVsbSbhVgeE9vhv7nbXi1XDb NCjHT15WosLC00iHmE5uYYADEJ58tauiv5z5ksH4UaJCJhAHe6mkFbB4KBMy163OiHyQ Mmiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=i35W5hbs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e9-20020a170902ef4900b0015e8e1a32d6si9045799plx.603.2022.06.13.06.02.07; Mon, 13 Jun 2022 06:02:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=i35W5hbs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344792AbiFMKsB (ORCPT + 99 others); Mon, 13 Jun 2022 06:48:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348075AbiFMKoI (ORCPT ); Mon, 13 Jun 2022 06:44:08 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6CC320F49; Mon, 13 Jun 2022 03:25:18 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 81E20B80E93; Mon, 13 Jun 2022 10:25:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D9044C34114; Mon, 13 Jun 2022 10:25:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655115916; bh=QO1vEa+m3jO9JUmuL0HAHMWrZwYOkvWhBQS391t7hzc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i35W5hbsrD1HJHA8Z2hfQwbDiF5hqv7Jlo5zSDlQXHIIqTAVwsc0tAqDV9oNi100H rIHEzS8KHu6NPYHMW9/WocYu/K2l6lEcJHhm9/ebDaniCNLjEkF1eQ4/g61GCHXdpm PPJcjckV6/vzSF/dErhud3rKqedBUlQEzjJmBhf4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaohe Lin , "Rafael J. Wysocki" , Mel Gorman , Minchan Kim , KAMEZAWA Hiroyuki , KOSAKI Motohiro , Andrew Morton , Sasha Levin Subject: [PATCH 4.14 088/218] drivers/base/node.c: fix compaction sysfs file leak Date: Mon, 13 Jun 2022 12:09:06 +0200 Message-Id: <20220613094923.204982271@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094908.257446132@linuxfoundation.org> References: <20220613094908.257446132@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Miaohe Lin [ 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 Cc: Greg Kroah-Hartman Cc: Rafael J. Wysocki Cc: Mel Gorman Cc: Minchan Kim Cc: KAMEZAWA Hiroyuki Cc: KOSAKI Motohiro Signed-off-by: Andrew Morton Signed-off-by: Sasha Levin --- drivers/base/node.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/base/node.c b/drivers/base/node.c index 5c39f14d15a5..57eef6b24448 100644 --- a/drivers/base/node.c +++ b/drivers/base/node.c @@ -337,6 +337,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 */ device_unregister(&node->dev); -- 2.35.1