hugetlb.txt 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. HugeTLB Controller
  2. -------------------
  3. The HugeTLB controller allows to limit the HugeTLB usage per control group and
  4. enforces the controller limit during page fault. Since HugeTLB doesn't
  5. support page reclaim, enforcing the limit at page fault time implies that,
  6. the application will get SIGBUS signal if it tries to access HugeTLB pages
  7. beyond its limit. This requires the application to know beforehand how much
  8. HugeTLB pages it would require for its use.
  9. HugeTLB controller can be created by first mounting the cgroup filesystem.
  10. # mount -t cgroup -o hugetlb none /sys/fs/cgroup
  11. With the above step, the initial or the parent HugeTLB group becomes
  12. visible at /sys/fs/cgroup. At bootup, this group includes all the tasks in
  13. the system. /sys/fs/cgroup/tasks lists the tasks in this cgroup.
  14. New groups can be created under the parent group /sys/fs/cgroup.
  15. # cd /sys/fs/cgroup
  16. # mkdir g1
  17. # echo $$ > g1/tasks
  18. The above steps create a new group g1 and move the current shell
  19. process (bash) into it.
  20. Brief summary of control files
  21. hugetlb.<hugepagesize>.limit_in_bytes # set/show limit of "hugepagesize" hugetlb usage
  22. hugetlb.<hugepagesize>.max_usage_in_bytes # show max "hugepagesize" hugetlb usage recorded
  23. hugetlb.<hugepagesize>.usage_in_bytes # show current usage for "hugepagesize" hugetlb
  24. hugetlb.<hugepagesize>.failcnt # show the number of allocation failure due to HugeTLB limit
  25. For a system supporting two hugepage size (16M and 16G) the control
  26. files include:
  27. hugetlb.16GB.limit_in_bytes
  28. hugetlb.16GB.max_usage_in_bytes
  29. hugetlb.16GB.usage_in_bytes
  30. hugetlb.16GB.failcnt
  31. hugetlb.16MB.limit_in_bytes
  32. hugetlb.16MB.max_usage_in_bytes
  33. hugetlb.16MB.usage_in_bytes
  34. hugetlb.16MB.failcnt