linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hugetlb_cgroup: fix wrong hugetlb cgroup numa stat
@ 2022-07-23  7:38 Miaohe Lin
  2022-07-23 13:44 ` Muchun Song
  0 siblings, 1 reply; 2+ messages in thread
From: Miaohe Lin @ 2022-07-23  7:38 UTC (permalink / raw)
  To: akpm
  Cc: keescook, mike.kravetz, almasrymina, shakeelb, linux-mm,
	linux-kernel, linmiaohe

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 <linmiaohe@huawei.com>
---
 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.23.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] hugetlb_cgroup: fix wrong hugetlb cgroup numa stat
  2022-07-23  7:38 [PATCH] hugetlb_cgroup: fix wrong hugetlb cgroup numa stat Miaohe Lin
@ 2022-07-23 13:44 ` Muchun Song
  0 siblings, 0 replies; 2+ messages in thread
From: Muchun Song @ 2022-07-23 13:44 UTC (permalink / raw)
  To: Miaohe Lin
  Cc: akpm, keescook, mike.kravetz, almasrymina, shakeelb, linux-mm,
	linux-kernel

On Sat, Jul 23, 2022 at 03:38:04PM +0800, Miaohe Lin wrote:
> 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 <linmiaohe@huawei.com>

Thanks for fixing this.

Acked-by: Muchun Song <songmuchun@bytedance.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-07-23 13:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-23  7:38 [PATCH] hugetlb_cgroup: fix wrong hugetlb cgroup numa stat Miaohe Lin
2022-07-23 13:44 ` Muchun Song

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).