Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 394419 - portage: provide a make.conf option for changing to cgroups (configuring them if needed) on package operations
Summary: portage: provide a make.conf option for changing to cgroups (configuring them...
Status: UNCONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Enhancement/Feature Requests (show other bugs)
Hardware: All Linux
: Normal minor (vote)
Assignee: Portage team
URL: http://en.gentoo-wiki.com/wiki/Portag...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-12 09:32 UTC by Denis Lisov
Modified: 2023-11-12 06:58 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Denis Lisov 2011-12-12 09:32:31 UTC
cgroups are a mechanism which may be used for conveniently limiting resource usage of the build process. For example, memory cgroup may be used for limiting the memory usage and avoiding heavy swap-out of desktop apps during build which makes the desktop barely usable.

Currently it's possible to use cgroups manually (add the emerge process PID by hand), configure libcgroup to do so or hook into PORTAGE_IONICE_COMMAND as suggested on the wiki ( http://en.gentoo-wiki.com/wiki/Portage_cgroups ); however, a dedicated make.conf variable would be nice to have.

Reproducible: Always

Steps to Reproduce:
1. Take a PC with a limited amount of memory (in my case it's a dual-core laptop with 2GB RAM)
2. Start building a memory-heavy package (with my default of MAKEOPTS="-j3" emerge qemu-kvm is heavy enough; firefox also consumes lots of memory during linking libxul.so)
3. Try to use the desktop apps during build (for example, Firefox)
Actual Results:  
When memory consumption spikes, the desktop and Firefox become barely usable for several minutes due to swapping. There is no obvious way to limit its memory consumption and/or use other cgroups' limits for portage.

Expected Results:  
Easy configuration of memory limits and other cgroups features, no more difficult than adding to make.conf something like
PORTAGE_CGROUPS="memory:portage"
PORTAGE_CGROUP_OPTIONS="memory.limit_in_bytes:1G"
by copying from the make.conf(5) man page and modifying the limit value. Portage should be easily configurable for a user wishing its memory consumption to be limited so that his workflow is not interrupted by freezes even if this may make the build several times longer.
Comment 1 Brian Harring (RETIRED) gentoo-dev 2011-12-12 10:33:44 UTC
Drop the PORTAGE_ prefixing; aside from being redundant, for pkgcore I was already intending functionality of this sort and not having yet another portage_ var would be rather nice...