From patchwork Sat Jul 23 07:38:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12927110 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3659C43334 for ; Sat, 23 Jul 2022 07:38:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A9C126B0071; Sat, 23 Jul 2022 03:38:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A4C296B0073; Sat, 23 Jul 2022 03:38:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 93A086B0074; Sat, 23 Jul 2022 03:38:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 845BD6B0071 for ; Sat, 23 Jul 2022 03:38:23 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 56782C013A for ; Sat, 23 Jul 2022 07:38:23 +0000 (UTC) X-FDA: 79717561686.07.395EE06 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by imf09.hostedemail.com (Postfix) with ESMTP id 54249140026 for ; Sat, 23 Jul 2022 07:38:22 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.53]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4LqdRq25n1zGp8s; Sat, 23 Jul 2022 15:37:11 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sat, 23 Jul 2022 15:38:16 +0800 From: Miaohe Lin To: CC: , , , , , , Subject: [PATCH] hugetlb_cgroup: fix wrong hugetlb cgroup numa stat Date: Sat, 23 Jul 2022 15:38:04 +0800 Message-ID: <20220723073804.53035-1-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1658561903; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=HpTtq1kwgOWGRwuUaoSk1q8RIxb81691UT35EXAh9N4=; b=0m9KJj0UOfNfJRLu06m9r0oPRqa+8NPrD7cnNXs6FOEc3L/IRc5WGpZahApfLYfOw9PHkY d7ChIUx170nk0HwxhNC9BL1YrYqEyr/iF57Fpzi/RedCScHTxO+dd9NjO+e/zeIk4KcFgx CQDu9nTdbiqFVfyj66S2MlOnGQ5zs8s= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1658561903; a=rsa-sha256; cv=none; b=GqZtiBQ5ccLqm8fDCEXT0BivGC6J3rk9GnjHs6aSESC4d9ABO1V7s2yon3pmMELpc+BMM/ cxfLC67itXvp/viCSCdN+BljfY4/ECZl4hWQbw9vakRAvc9eKgoY6jsjh4Sv/NnYSbCEqF DIlE8H6L+RHpzRH42jQm/GOfQPDiqAI= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf09.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com X-Stat-Signature: 5at18m9dkijh4gsweugrhnosroiwbjdh X-Rspamd-Queue-Id: 54249140026 Authentication-Results: imf09.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf09.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1658561902-915832 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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. Fixes: f47761999052 ("hugetlb: add hugetlb.*.numa_stat file") Signed-off-by: Miaohe Lin Acked-by: Muchun Song --- 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;