# Proposed enhancements to mem/swap accounting in the cgroup hook

**URL:** <https://community.openpbs.org/t/proposed-enhancements-to-mem-swap-accounting-in-the-cgroup-hook/2511>\
**Category:** Developers\
**Created:** [February 26, 2021, 11:04am UTC](https://community.openpbs.org/t/proposed-enhancements-to-mem-swap-accounting-in-the-cgroup-hook/2511 "2021-02-26T11:04:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexis.cousein](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/alexis.cousein/32/265_2.png) [@alexis.cousein](https://community.openpbs.org/u/alexis.cousein)\
**Post date:** [February 26, 2021, 11:04am UTC](https://community.openpbs.org/t/proposed-enhancements-to-mem-swap-accounting-in-the-cgroup-hook/2511/1 "2021-02-26T11:04:55Z")

</div>

Some proposed changes to the cgroup, for two issues:

-it’s possible to get the scheduler to schedule some jobs on a node where swap (i.e. resources\_available.vmem - resources\_available.mem) will get depleted and kill jobs. To avoid that, you need to account for swap spearately as a schedulable resource.

-some sites want jobs without explicit memory limits to be allowed to use the entire host’s memory.

Design document at:

[https://openpbs.atlassian.net/wiki/spaces/PD/pages/2576613377/Improve+memory+swap+management+in+the+cgroup+hook](https://openpbs.atlassian.net/wiki/spaces/PD/pages/2576613377/Improve+memory+swap+management+in+the+cgroup+hook)

---

<div class="post-metadata">

**Author:** ![lisa-altair](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/lisa-altair/32/643_2.png) [@lisa-altair](https://community.openpbs.org/u/lisa-altair)\
**Post date:** [March 16, 2021, 7:39pm UTC](https://community.openpbs.org/t/proposed-enhancements-to-mem-swap-accounting-in-the-cgroup-hook/2511/2 "2021-03-16T19:39:53Z")

</div>

In the section “To enable cgswap management, a site has to:” It would be good to add to the top of the list “enable the cgroups hook”.

- what is **exclhost\_ignore\_default** set to by default?

Looks good otherwise. Thanks for proposing it.

---

<div class="post-metadata">

**Author:** ![lisa-altair](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/lisa-altair/32/643_2.png) [@lisa-altair](https://community.openpbs.org/u/lisa-altair)\
**Post date:** [March 16, 2021, 9:27pm UTC](https://community.openpbs.org/t/proposed-enhancements-to-mem-swap-accounting-in-the-cgroup-hook/2511/3 "2021-03-16T21:27:39Z")

</div>

What is the behavior if both **enforce\_default** and **exclhost\_ignore\_default** are set to True?

---

<div class="post-metadata">

**Author:** ![alexis.cousein](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/alexis.cousein/32/265_2.png) [@alexis.cousein](https://community.openpbs.org/u/alexis.cousein)\
**Post date:** [March 17, 2021, 9:36am UTC](https://community.openpbs.org/t/proposed-enhancements-to-mem-swap-accounting-in-the-cgroup-hook/2511/4 "2021-03-17T09:36:57Z")

</div>

" What is the behavior if both **enforce\_default** and **exclhost\_ignore\_default** are set to True?"

That’s what you’d expect to see when you want the latter to be true. Defaults are enforced for jobs that do no use exclhost placement, but not for jobs that use exclhost placement.

enforce\_default set to False and exclhost\_ignore\_default set to True is tautological: if defaults are not enforced for any jobs, there is no need to ignore them for a subset of jobs.

---

<div class="post-metadata">

**Author:** ![alexis.cousein](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/alexis.cousein/32/265_2.png) [@alexis.cousein](https://community.openpbs.org/u/alexis.cousein)\
**Post date:** [March 17, 2021, 9:37am UTC](https://community.openpbs.org/t/proposed-enhancements-to-mem-swap-accounting-in-the-cgroup-hook/2511/5 "2021-03-17T09:37:34Z")

</div>

" \* what is **exclhost\_ignore\_default** set to by default?"

false, which means behaviour is unchanged by default.

---

<div class="post-metadata">

**Author:** ![lisa-altair](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/lisa-altair/32/643_2.png) [@lisa-altair](https://community.openpbs.org/u/lisa-altair)\
**Post date:** [March 18, 2021, 9:36pm UTC](https://community.openpbs.org/t/proposed-enhancements-to-mem-swap-accounting-in-the-cgroup-hook/2511/6 "2021-03-18T21:36:03Z")

</div>

Thank you for making the updates. Look good
