lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Wed, 10 Nov 2021 18:04:57 -0800 From: Shakeel Butt <shakeelb@...gle.com> To: Mina Almasry <almasrymina@...gle.com> Cc: Mike Kravetz <mike.kravetz@...cle.com>, Andrew Morton <akpm@...ux-foundation.org>, Shuah Khan <shuah@...nel.org>, Miaohe Lin <linmiaohe@...wei.com>, Oscar Salvador <osalvador@...e.de>, Michal Hocko <mhocko@...e.com>, Muchun Song <songmuchun@...edance.com>, David Rientjes <rientjes@...gle.com>, Jue Wang <juew@...gle.com>, Yang Yao <ygyao@...gle.com>, Joanna Li <joannali@...gle.com>, Cannon Matthews <cannonmatthews@...gle.com>, linux-mm@...ck.org, linux-kernel@...r.kernel.org Subject: Re: [PATCH v6] hugetlb: Add hugetlb.*.numa_stat file On Wed, Nov 10, 2021 at 5:50 PM Mina Almasry <almasrymina@...gle.com> wrote: > > For hugetlb backed jobs/VMs it's critical to understand the numa > information for the memory backing these jobs to deliver optimal > performance. > > Currently this technically can be queried from /proc/self/numa_maps, but > there are significant issues with that. Namely: > 1. Memory can be mapped or unmapped. > 2. numa_maps are per process and need to be aggregated across all > processes in the cgroup. For shared memory this is more involved as > the userspace needs to make sure it doesn't double count shared > mappings. > 3. I believe querying numa_maps needs to hold the mmap_lock which adds > to the contention on this lock. > > For these reasons I propose simply adding hugetlb.*.numa_stat file, > which shows the numa information of the cgroup similarly to > memory.numa_stat. > > On cgroup-v2: > cat /sys/fs/cgroup/unified/test/hugetlb.2MB.numa_stat > total=2097152 N0=2097152 N1=0 > > On cgroup-v1: > cat /sys/fs/cgroup/hugetlb/test/hugetlb.2MB.numa_stat > total=2097152 N0=2097152 N1=0 > hierarichal_total=2097152 N0=2097152 N1=0 > > This patch was tested manually by allocating hugetlb memory and querying > the hugetlb.*.numa_stat file of the cgroup and its parents. >  > Cc: Mike Kravetz <mike.kravetz@...cle.com> > Cc: Andrew Morton <akpm@...ux-foundation.org> > Cc: Shuah Khan <shuah@...nel.org> > Cc: Miaohe Lin <linmiaohe@...wei.com> > Cc: Oscar Salvador <osalvador@...e.de> > Cc: Michal Hocko <mhocko@...e.com> > Cc: Muchun Song <songmuchun@...edance.com> > Cc: David Rientjes <rientjes@...gle.com> > Cc: Shakeel Butt <shakeelb@...gle.com> > Cc: Jue Wang <juew@...gle.com> > Cc: Yang Yao <ygyao@...gle.com> > Cc: Joanna Li <joannali@...gle.com> > Cc: Cannon Matthews <cannonmatthews@...gle.com> > Cc: linux-mm@...ck.org > Cc: linux-kernel@...r.kernel.org > > Signed-off-by: Mina Almasry <almasrymina@...gle.com> Reviewed-by: Shakeel Butt <shakeelb@...gle.com>
Powered by blists - more mailing lists