From nobody Fri Oct 24 10:12:31 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 55AA1C00140 for ; Mon, 15 Aug 2022 23:34:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346702AbiHOXeQ (ORCPT ); Mon, 15 Aug 2022 19:34:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347132AbiHOX12 (ORCPT ); Mon, 15 Aug 2022 19:27:28 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB6BFD5E98; Mon, 15 Aug 2022 13:07:16 -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 F203FB80EAD; Mon, 15 Aug 2022 20:07:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 345BEC433C1; Mon, 15 Aug 2022 20:07:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660594033; bh=k/jl+hiL7h61ReI0pIPxD1nbi8Tvs1yvqiCnRfOIhME=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ob29ykvkrRfC0QIu3ygNtbXfq2rNmv8dGqKW5NuEv3Ush80Y/R4LjpKwqdga+gKe4 qqkO/VBueYo6SanGR8O7cDOXtMmXQVGrld42+0W3rp9dH9gZIN6yR7KLbFXeglfPrR XMSDeRa4zqCLP3GW2HEXcGSdepp/uXaPuhL+8TRQ= 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.18 1045/1095] hugetlb_cgroup: fix wrong hugetlb cgroup numa stat Date: Mon, 15 Aug 2022 20:07:24 +0200 Message-Id: <20220815180512.318076322@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 i= dx) /* Add the numa stat file */ cft =3D &h->cgroup_files_dfl[6]; snprintf(cft->name, MAX_CFTYPE_NAME, "%s.numa_stat", buf); + cft->private =3D MEMFILE_PRIVATE(idx, 0); cft->seq_show =3D hugetlb_cgroup_read_numa_stat; cft->flags =3D CFTYPE_NOT_ON_ROOT; =20 --=20 2.35.1