Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3125002rwb; Mon, 15 Aug 2022 18:45:05 -0700 (PDT) X-Google-Smtp-Source: AA6agR4ayHEnYOe5RWJ++wLFP+134+VnhRr0FCPIQolLOGBYiGMyMd3dOTvce6BqRGbYjqCDNW6a X-Received: by 2002:a17:906:9749:b0:730:aaee:30e2 with SMTP id o9-20020a170906974900b00730aaee30e2mr11613523ejy.248.1660614305483; Mon, 15 Aug 2022 18:45:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660614305; cv=none; d=google.com; s=arc-20160816; b=vglyD7QamShnDRhpg/q4zYjBaqJ8aLk6ESuHvK22nlqsJsFpJwPvD5g+b4WHHUaNPD GcgBe5qcGKaf36RWsaJGsdm1f8oOx1dCVYEtLII9Rh5kMCTgaqoTySqqxBCirK3/AvK8 ytf9X+UZn7PexXKUni6Dh3FNwI765x9i/w4xFPNS45mcsc3o/C3xUQbC/CVdfZ2IJHx5 +ED4vZzem/oW56MXR803VhL8WL3SLOm82CXwUTYrpjs4tKz12XRbOSmhJpGvYz2tFFQT llfEGZ4cPl1lDogwv4zT5ov2ldiT7qksjGL64xhmzZ70GgFg7MejqZuhHsRexp1CfUSM 4JWQ== 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=Oth3Y+kdxDEvM2T3yi1XGob0X3WO5eqhO/9VK7FldTg=; b=eU3LLOwwOxcj1osw71xhzVuFrYLGZNg5raF6hhJGSPKiNH4fK9+a8GxgWZP52Jr/Tc 2PqTFa9Q3k8a45f4xo4vIfc/z/Wo+ZYWF7bGADpGFFeeoaWcR0njCX25w6OvqrKcP7GP cYjbu1bYSHwg+iFjfXfpomuW9lSC+xjrC7wJlcWgZyNc6MrwDqRtqQz4JHIi8KR6R7lJ uuR+6N12YPL4HNd3Nj3IFzOemNwR6Nu6bLgqUeKe+MQmD/HxaK7SYFGfy/22SofrrOYJ RfCeCvjAuSx45gICm97LPaLQgYcIg6X59u6K5iUlCjNgggrg4ep+ABqZK4gNTf/ZDulx gYbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=J4eJBWPu; 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 h27-20020a170906399b00b00730a3b51724si7534597eje.530.2022.08.15.18.44.39; Mon, 15 Aug 2022 18:45:05 -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=J4eJBWPu; 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 S245343AbiHPBDw (ORCPT + 99 others); Mon, 15 Aug 2022 21:03:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348626AbiHPA5q (ORCPT ); Mon, 15 Aug 2022 20:57:46 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01411DB062; Mon, 15 Aug 2022 13:49:10 -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 dfw.source.kernel.org (Postfix) with ESMTPS id D766F6126A; Mon, 15 Aug 2022 20:49:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E0B31C433C1; Mon, 15 Aug 2022 20:49:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660596547; bh=k/jl+hiL7h61ReI0pIPxD1nbi8Tvs1yvqiCnRfOIhME=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J4eJBWPuxbY6xpQiElASrl8zB3WSnD6nxoCC52+oBIVqfJPb7CJ4tMM+4buR8Z1Lc SebwG13sPfQQ+bxOm7X24z83lMcmLaZNqnXRf9gt0RXUNP75YKKc8/2z54UWk1iWgj 2zuL6ist79J2c1hnU7K7C2R3YDDWWT0GAZvsyPIs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaohe Lin , Muchun Song , Kees Cook , Mike Kravetz , Mina Almasry , Shakeel Butt , Andrew Morton , Sasha Levin Subject: [PATCH 5.19 1113/1157] hugetlb_cgroup: fix wrong hugetlb cgroup numa stat Date: Mon, 15 Aug 2022 20:07:49 +0200 Message-Id: <20220815180524.831965088@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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 2727cfe4072a35ce813e3708f74c135de7da8897 ] We forget to set cft->private for numa stat file. As a result, numa stat of hstates[0] is always showed for all hstates. Encode the hstates index into cft->private to fix this issue. Link: https://lkml.kernel.org/r/20220723073804.53035-1-linmiaohe@huawei.com Fixes: f47761999052 ("hugetlb: add hugetlb.*.numa_stat file") Signed-off-by: Miaohe Lin Acked-by: Muchun Song Cc: Kees Cook Cc: Mike Kravetz Cc: Mina Almasry Cc: Shakeel Butt Cc: Signed-off-by: Andrew Morton Signed-off-by: Sasha Levin --- mm/hugetlb_cgroup.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/hugetlb_cgroup.c b/mm/hugetlb_cgroup.c index f9942841df18..c86691c431fd 100644 --- a/mm/hugetlb_cgroup.c +++ b/mm/hugetlb_cgroup.c @@ -772,6 +772,7 @@ static void __init __hugetlb_cgroup_file_dfl_init(int idx) /* Add the numa stat file */ cft = &h->cgroup_files_dfl[6]; snprintf(cft->name, MAX_CFTYPE_NAME, "%s.numa_stat", buf); + cft->private = MEMFILE_PRIVATE(idx, 0); cft->seq_show = hugetlb_cgroup_read_numa_stat; cft->flags = CFTYPE_NOT_ON_ROOT; -- 2.35.1