Skip to content

memcg: Add memcg extension 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 Latest10 patches 43 repliesIn review

Changes from v3 from the cover letter

* Address review feedback.
* bug fix in cgroup removal related parent charging with use_hierarchy set

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10hugetlb: rename max_hstate to hugetlb_max_hstatemm/hugetlb.c+7 -72 replies
2/10hugetlbfs: don't use ERR_PTR with VM_FAULT* valuesmm/hugetlb.c+13 -54 replies
3/10hugetlbfs: Add an inline helper for finding hstate indexinclude/linux/hugetlb.h mm/hugetlb.c+16 -82 replies
4/10memcg: Add HugeTLB extensioninclude/linux/hugetlb.h include/linux/memcontrol.h init/Kconfig +2 more+190 -114 replies
5/10hugetlb: add charge/uncharge calls for HugeTLB alloc/freemm/hugetlb.c mm/memcontrol.c+25 -17 replies
6/10memcg: track resource index in cftype privatemm/memcontrol.c+21 -61 reply
7/10hugetlbfs: Add memcg control files for hugetlbfsinclude/linux/hugetlb.h include/linux/memcontrol.h mm/hugetlb.c +1 more+96 -14 replies
8/10hugetlbfs: Add a list for tracking in-use HugeTLB pagesinclude/linux/hugetlb.h mm/hugetlb.c+19 -55 replies
9/10memcg: move HugeTLB resource count to parent cgroup on memcg removalinclude/linux/hugetlb.h include/linux/memcontrol.h mm/hugetlb.c +1 more+119 -113 replies
10/10memcg: Add memory controller documentation for hugetlb managementDocumentation/cgroups/memory.txt+29 -01 reply

Reviews trailers per patch

6 of 10 patches have a Reviewed-by or Acked-by.

PatchHillf DantonKAMEZAWA HiroyukiMichal Hocko
1/10A-b R-b A-b
2/10R-b
3/10R-b A-b
4/10
5/10A-b R-b
6/10A-b
7/10
8/10R-b
9/10
10/10

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

Read the v1 thread

Cover letter [PATCH -V4 00/10] memcg: Add memcg extension to control HugeTLB allocation

Hi,

This patchset implements a memory controller extension to control HugeTLB allocations. The extension 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.

Changes from v3:
* Address review feedback.
* bug fix 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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>