Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3083732rwb; Mon, 15 Aug 2022 17:43:50 -0700 (PDT) X-Google-Smtp-Source: AA6agR5JngKzYkMiqZavc78JWP827PbUpWmxg/gsCmy1/Y+XZvaYq+Yo5xK2yKPjskVEncocbzCT X-Received: by 2002:a17:907:1c26:b0:730:960f:118 with SMTP id nc38-20020a1709071c2600b00730960f0118mr11696995ejc.650.1660610630073; Mon, 15 Aug 2022 17:43:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660610630; cv=none; d=google.com; s=arc-20160816; b=quof/V4nixjfVmEPAyqxPSha2LYbcEowH2qtTCq5Q7dOEal2C2w9PHAl8SFTGBq90p Rw5A4uBxDcBM9ja6AUqWKANX8qN+PajN80Ja/hOFEnYuyySkyf/TwT4hMGP+GfV3g+Ui 9V7YmMpAFop4rEwLRLlHmLKMfE8DHfLtYz7gBDp9GJkckZhNNdg3PkglCynOkKcauXqs i6G4nQjN7wjMHqeNCxiTEXS09sIAdisRk6OuO/P81UKbF99uM9BLhjjaSI5yAvs4MJ4/ CfV9louVTozvMcIEKnUoRzuEOVc/NS/ZmMZ/iadbjefKXeK9/tV53qHafRCvyP16nWUx aq2Q== 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=xntZFdRjoSIwc81GWGSlS78htVbIt6NRNKPXkXe2mtr6tLudcilmaOOBeFJirptpMI Hw4FQfh1EyMqF6+q67/ZyKi7VhXUqVCK6IzNhapH52c9NVyOiE51Q8Jjtdq/AAth7SPU bD7K7QcopYUkJAw1bvYgw/brMynGOFH8bHMdIHLZBo/UzelRN2FEzJDJtwmPIaOyyn/A V9ZPd9y89ocW32V1IgAXVzJn8Ijk6/IDhkPA6TbRlaYzlOEoaPqgK2uD8UgqS0EJ47XG rrG+jrLoehgK+JwncKxgam9izQiIJ2Fzcpl6Ce5Y8QvAIIZpF4nrFgTUbGatieS4tbuj ASvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ob29ykvk; 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 h20-20020aa7c614000000b0043d267cee03si8093854edq.299.2022.08.15.17.43.24; Mon, 15 Aug 2022 17:43:50 -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=ob29ykvk; 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 S1344842AbiHOXeO (ORCPT + 99 others); Mon, 15 Aug 2022 19:34:14 -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-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