Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2199790iof; Tue, 7 Jun 2022 23:01:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8x3WkdFw5pjA1ZMZ/J7SVXOEYEkcOKqJb4xnW7dLEU/DWPZfDSPCQdpI6F8Nz0c9rHvsu X-Received: by 2002:a17:902:6b8b:b0:14d:66c4:f704 with SMTP id p11-20020a1709026b8b00b0014d66c4f704mr32983776plk.53.1654668062320; Tue, 07 Jun 2022 23:01:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654668062; cv=none; d=google.com; s=arc-20160816; b=lfwr9Jk1xvRzFVvuOJR1O3tw1kGaGJCp/0rQ/txZqTlBB8xQ/gPFb4hoofv+PSy5tP sqmgzyL3m15OHSr/Ou+Wz6z/+sEsSaa1/tWo2UhFj9aI3noEsZm2WFSYfT/joGa048dP KDamnUr84vK8m27CKw1eFalJ61C9tVLpURglOJXgj1+NgfOyEcM9uHQvt+ZUPtjBjtYv Ob5XtSKQLJpLGQxerMTxj96s4rCkH2NmocUOA+NWnO6GEQKF4AkarvDE6WhDt/9z1iZk kqfsWAR1pYIGyGyg8t8N0pgD54S4dSLoABt3Xr1jI7oKaTp7ajs3tme/0149KAKlAppv qVkg== 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=EST6oMpgShxdnSoTbQ8yRaa1oCrFJ/dRNmukmaUIGPQ=; b=d9IRjYKRo65qIrWHEXnyzYWrZbzqMnL4Cd29ouJBZXKHhGF6CucT/ZGayp5lFpeUpc Xrn3JopngjdtWMkYD+3zDHJOeQYRIV7+NV72BNzwixYhYvuf39tiygCAE6qLOD3H9YnZ DkllBjXWClqTke64O03Wz+8jmuXa3Nu/FXH6AkEEVQf2J0dauk4XP8n9tlkp/LFDFSty EjmIe/+kPbnp1mae+QdWe3ngQdAdh8xojAbYh0OSsdKUhw27PZgAikn+9qPCnchDCkBR 4V/Kl/FAq2lnXUZP/28Ro1idqFldMy0GZ1Y55sRLBcqhQeHOGvWWQLtILDG+1Wo9MWus 8Sbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IsjPHNy+; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id m19-20020a63ed53000000b003f605851c65si26609287pgk.303.2022.06.07.23.01.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 23:01:02 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IsjPHNy+; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 500334B9292; Tue, 7 Jun 2022 22:25:49 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230473AbiFHBCF (ORCPT + 99 others); Tue, 7 Jun 2022 21:02:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1382442AbiFGWDy (ORCPT ); Tue, 7 Jun 2022 18:03:54 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28A9024F979; Tue, 7 Jun 2022 12:14:51 -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 23C85B822C0; Tue, 7 Jun 2022 19:14:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A633C341C0; Tue, 7 Jun 2022 19:14:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654629285; bh=ZBQ4EFzhN4RnMkuYCNB/HRS9XOCUG2rEa2pgGyuxLhQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IsjPHNy+g8ZPKqVq0mayJ2K4RCliPqjVNz5e4GUQpzLO3iW84/udeMOzjcJhDES+k wyBSEeamRy09EvFxwGsSMGLVCxTd3uf2IoEdNgyLQTkbwWwTxY1AM2hsQn86fiIvGF 2vvDbMdQiNVfRbVIW3RroqB/ZruAEe7eOZ0Nn2IY= 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 5.18 595/879] drivers/base/node.c: fix compaction sysfs file leak Date: Tue, 7 Jun 2022 19:01:53 +0200 Message-Id: <20220607165020.123481067@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@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=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 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.35.1