Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp438182iog; Mon, 13 Jun 2022 06:02:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVRX3Eqc7IcqtS0oHAUnpudoPotUiPRvDGj0xLZCa6eczC84uMgu9QjXz5eCjiSE3f2qnT X-Received: by 2002:a17:903:18f:b0:167:47f3:4a with SMTP id z15-20020a170903018f00b0016747f3004amr50681253plg.70.1655125347378; Mon, 13 Jun 2022 06:02:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655125347; cv=none; d=google.com; s=arc-20160816; b=y01gjn3kuFMk7y3kl1O8us1/ZYR19QZo/v0u9cUcdm6g95z3xMdIbDja+z40XwIP+A ZLj+ZsmktoGo7Zp3FMPU9gBUOq/d66H/lOsJ8sgwedKROG0QFzQSJouvuuiwEdka7kjq yGJAS4jCOaM8PPX/egNF44fQ8IZ0emGqc9JgOD78JG41LywrVfbcPRYv61lQ7jYWd0/W 2rz/4F6lIHSHd0LsDznL/WStlzsHTCrQSSI8/EVDmzNaV/N8Bgv5+ha1VxEygKfv5j1b lV9PbZlEdxOw7HpDM7x4HQChtihAkXoWswVdT7QgCVvIFR/9OFUZkxy2KF5804SILkBT tBHw== 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=idq6M18gUcDzsq8lFcVHPsTnIu/6TZ2/f+1BGoXn/KM=; b=S7fy8i8pHVc/yZ/HSTpSqwNYgt8STqc81luYJ38PgFhy5IIYyZW6HJKxqSmiMJLCkJ i5iBoqHYkhLHJsMv7Z7Wdmx/n91TaD9ZHsQQAhISXLBTkKEVq6sO4Ii0gPE2p6VYvms6 ZjND7uODEPLAoHJtyRlwsUaEgn5IlCNtTk9EjI2O1lfIG1wo0YTUaBVDHT4wL0OI3I9E tVAYWneRrRp7QHUtKlJDSfHKJzhW1+pmEtIs92Xc401Q6pzbVLQaBdel76+zUdyIFUm3 UlU/5and/hocK4wQkx+T7qM9ubC15W7DJcdpkPJ2iwnOtazGXKeynVp2Woh1+IluhyZF 9FjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="b/s8lhhK"; 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 b24-20020a170902b61800b0016223c6e629si9022737pls.235.2022.06.13.06.02.12; Mon, 13 Jun 2022 06:02:27 -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="b/s8lhhK"; 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 S1352961AbiFMLW6 (ORCPT + 99 others); Mon, 13 Jun 2022 07:22:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353710AbiFMLQP (ORCPT ); Mon, 13 Jun 2022 07:16:15 -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 EF56A13E07; Mon, 13 Jun 2022 03:39:28 -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 A5DBEB80EAA; Mon, 13 Jun 2022 10:39:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 025A3C34114; Mon, 13 Jun 2022 10:39:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655116766; bh=oaZItaQZLCkHTLPv6shT9hrmQvSaM+7Tplo0xN2jbiE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b/s8lhhKSM96WAFITRRu+G4hZYglHo7qths0MqDspjpGnwJhDPZ6emEi+qC8dJ7XX /vXtjuc0GNyNzBymEQj4FArN+dd/pFsv+NZGkH8/gztVsiZ1fDs3neKyExxNvT1F+0 qwVqagooTU8r93nmXQit+30aX6iRp9nQvcg6qpU8= 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.4 177/411] drivers/base/node.c: fix compaction sysfs file leak Date: Mon, 13 Jun 2022 12:07:30 +0200 Message-Id: <20220613094933.965465268@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094928.482772422@linuxfoundation.org> References: <20220613094928.482772422@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 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); -- 2.35.1