Skip to content

hugetlbfs: Add cgroup resource controller for hugetlbfs

Aneesh Kumar K.V cgroups linux-mm lkml 1 version New

Get series with b4
b4 am 1329736902-26870-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com

Versions newest first

  1. v1 Latest9 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9hugetlbfs: Add new HugeTLB cgroupfs/hugetlbfs/Makefile fs/hugetlbfs/hugetlb_cgroup.c include/linux/cgroup_subsys.h +4 more+301 -30 replies
2/9hugetlbfs: Add usage and max usage files to hugetlb cgroupfs/hugetlbfs/hugetlb_cgroup.c include/linux/hugetlb.h include/linux/hugetlb_cgroup.h +1 more+36 -00 replies
3/9hugetlbfs: Add new region handling functions.fs/hugetlbfs/hugetlb_cgroup.c+127 -00 replies
4/9hugetlbfs: Add controller support for shared mappingfs/hugetlbfs/hugetlb_cgroup.c fs/hugetlbfs/inode.c include/linux/hugetlb_cgroup.h +1 more+212 -260 replies
5/9hugetlbfs: Add controller support for private mappingfs/hugetlbfs/hugetlb_cgroup.c include/linux/hugetlb.h include/linux/hugetlb_cgroup.h +1 more+123 -120 replies
6/9hugetlbfs: Switch to new region APIsfs/hugetlbfs/Makefile fs/hugetlbfs/hugetlb_cgroup.c fs/hugetlbfs/region.c +2 more+222 -2970 replies
7/9hugetlbfs: Add truncate region functionsfs/hugetlbfs/hugetlb_cgroup.c fs/hugetlbfs/region.c include/linux/hugetlb_cgroup.h+153 -10 replies
8/9hugetlbfs: Add task migration supportfs/hugetlbfs/hugetlb_cgroup.c fs/hugetlbfs/region.c include/linux/hugetlb.h +2 more+49 -2010 replies
9/9hugetlbfs: Add HugeTLB controller documentationDocumentation/cgroups/hugetlb.txt+54 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH -V1 0/9] hugetlbfs: Add cgroup resource controller for hugetlbfs

Hi,

This patchset implements a cgroup resource controller for HugeTLB pages. It is similar to the existing hugetlb quota support in that the limit is enforced at mmap(2) time and not at fault time. HugeTLB quota limit the number of huge pages that can allocated per superblock.

For shared mapping we track the region mapped by a task along with the hugetlb cgroup. We keep the hugetlb cgroup charged even after the task that did mmap(2) exit. The uncharge happens during truncate. For Private mapping we charge and uncharge from the current task cgroup.

A sample strace output for an application doing malloc with hugectl is given below. libhugetlbfs will fallback to normal pagesize if the HugeTLB mmap fails.

open("/mnt/libhugetlbfs.tmp.uhLMgy", O_RDWR|O_CREAT|O_EXCL, 0600) = 3 unlink("/mnt/libhugetlbfs.tmp.uhLMgy") = 0

.........

mmap(0x20000000000, 50331648, PROT_READ|PROT_WRITE, MAP_PRIVATE, 3, 0) = -1 ENOMEM (Cannot allocate memory)
write(2, "libhugetlbfs", 12libhugetlbfs) = 12
write(2, ": WARNING: New heap segment map" ....
mmap(NULL, 42008576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xfff946c0000
....

Changes from RFC post:
* Added support for HugeTLB cgroup hierarchy
* Added support for task migration
* Added documentation patch
* Other Bug fixes

-aneesh