Skip to contentSkip to conversation

hugetlb_cgroup: fix wrong hugetlb cgroup numa stat

PATCH Applied Miaohe Lin 2 participants 2 messages Jul 23, 2022

Subsystems (2)
lore
Share & tools
lore

Miaohe Lin

author
#0 lore raw

PATCH 1/1 hugetlb_cgroup: fix wrong hugetlb cgroup numa stat

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")
---
 mm/hugetlb_cgroup.c | 1 +
 1 file changed, 1 insertion(+)
mm/hugetlb_cgroup.c +1 -0
index f9942841df18..c86691c431fd 100644
@@ -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;
 
Signature · 1 line
2.23.0
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Miaohe Lin

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")

Thanks for fixing this.