Skip to content

hugetlb: Add HugeTLB controller to control HugeTLB allocation

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

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest15 patches 30 repliesIn review

Changes from V8 from the cover letter

* Address review feedback

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/15hugetlb: rename max_hstate to hugetlb_max_hstatemm/hugetlb.c+7 -70 replies
2/15hugetlb: don't use ERR_PTR with VM_FAULT* valuesmm/hugetlb.c+13 -50 replies
3/15hugetlb: add an inline helper for finding hstate indexinclude/linux/hugetlb.h mm/hugetlb.c+17 -90 replies
4/15hugetlb: use mmu_gather instead of a temporary linked list for accumulating pagesfs/hugetlbfs/inode.c include/linux/hugetlb.h mm/hugetlb.c +1 more+59 -336 replies
5/15hugetlb: avoid taking i_mmap_mutex in unmap_single_vma() for hugetlbmm/memory.c+1 -42 replies
6/15hugetlb: simplify migrate_huge_page()include/linux/migrate.h mm/memory-failure.c mm/migrate.c+25 -571 reply
7/15hugetlb: add a list for tracking in-use HugeTLB pagesinclude/linux/hugetlb.h mm/hugetlb.c+8 -51 reply
8/15hugetlb: Make some static variables globalinclude/linux/hugetlb.h mm/hugetlb.c+7 -52 replies
9/15mm/hugetlb: Add new HugeTLB cgroupinclude/linux/cgroup_subsys.h include/linux/hugetlb_cgroup.h init/Kconfig +2 more+181 -03 replies
10/15hugetlb/cgroup: Add the cgroup pointer to page lruinclude/linux/hugetlb_cgroup.h mm/hugetlb.c+41 -04 replies
11/15hugetlb/cgroup: Add charge/uncharge routines for hugetlb cgroupinclude/linux/hugetlb_cgroup.h mm/hugetlb.c mm/hugetlb_cgroup.c+133 -19 replies
12/15hugetlb/cgroup: Add support for cgroup removalmm/hugetlb_cgroup.c+68 -22 replies
13/15hugetlb/cgroup: add hugetlb cgroup control filesinclude/linux/hugetlb.h include/linux/hugetlb_cgroup.h mm/hugetlb.c +1 more+148 -02 replies
14/15hugetlb/cgroup: migrate hugetlb cgroup info from oldpage to new page during migrationinclude/linux/hugetlb_cgroup.h mm/hugetlb_cgroup.c mm/migrate.c+33 -03 replies
15/15hugetlb/cgroup: add HugeTLB controller documentationDocumentation/cgroups/hugetlb.txt+45 -01 reply

Reviews trailers per patch

All 15 patches have a Reviewed-by or Acked-by.

PatchDavid RientjesKAMEZAWA HiroyukiHillf DantonMichal HockoKOSAKI Motohiro
1/15A-b R-b A-b A-b
2/15R-b A-b A-b
3/15A-b R-b A-b
4/15R-b R-b
5/15A-b
6/15R-b R-b
7/15R-b R-b
8/15A-b R-b
9/15R-b R-b
10/15A-b R-b
11/15A-b R-b R-b
12/15A-b R-b
13/15A-b R-b
14/15A-b R-b
15/15R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v1 thread

Cover letter [PATCH -V9 00/15] hugetlb: Add HugeTLB controller to control HugeTLB allocation

Hi,

This patchset implements a cgroup resource controller for HugeTLB pages. The controller allows to limit the HugeTLB usage per control group and enforces the controller limit during page fault. Since HugeTLB doesn't support page reclaim, enforcing the limit at page fault time implies that, the application will get SIGBUS signal if it tries to access HugeTLB pages beyond its limit. This requires the application to know beforehand how much HugeTLB pages it would require for its use.

The goal is to control how many HugeTLB pages a group of task can allocate. It can be looked at as an extension of the existing quota interface which limits the number of HugeTLB pages per hugetlbfs superblock. HPC job scheduler requires jobs to specify their resource requirements in the job file. Once their requirements can be met, job schedulers like (SLURM) will schedule the job. We need to make sure that the jobs won't consume more resources than requested. If they do we should either error out or kill the application.

Patches are on top of v3.5-rc2

Changes from V8:
* Address review feedback

Changes from V7:
* Remove dependency on page_cgroup.
* Use page[2].lru.next to store HugeTLB cgroup information.

Changes from V6:
* Implement the controller as a seperate HugeTLB cgroup.
* Folded fixup patches in -mm to the original patches

Changes from V5:
* Address review feedback.

Changes from V4:
* Add support for charge/uncharge during page migration
* Drop the usage of page->lru in unmap_hugepage_range.

Changes from v3:
* Address review feedback.
* Fix a bug in cgroup removal related parent charging with use_hierarchy set

Changes from V2:
* Changed the implementation to limit the HugeTLB usage during page fault time. This simplifies the extension and keep it closer to memcg design. This also allows to support cgroup removal with less complexity. Only caveat is the application should ensure its HugeTLB usage doesn't cross the cgroup limit.

Changes from V1:
* Changed the implementation as a memcg extension. We still use the same logic to track the cgroup and range.

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

-aneesh

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>