aboutsummaryrefslogtreecommitdiff
path: root/include/linux/res_counter.h
AgeCommit message (Collapse)AuthorFilesLines
2008-04-29memcgroup: implement failcounter resetPavel Emelyanov1-0/+8
This is a very common requirement from people using the resource accounting facilities (not only memcgroup but also OpenVZ beancounters). They want to put the cgroup in an initial state without re-creating it. For example after re-configuring a group people want to observe how this new configuration fits the group needs without saving the previous failcnt value. Merge two resets into one mem_cgroup_reset() function to demonstrate how multiplexing work. Besides, I have plans to move the files, that correspond to res_counter to the res_counter.c file and somehow "import" them into controller. I don't know how to make it gracefully yet, but merging resets of max_usage and failcnt in one function will be there for sure. [[email protected]: coding-style fixes] Signed-off-by: Pavel Emelyanov <[email protected]> Acked-by: KAMEZAWA Hiroyuki <[email protected]> Cc: Balbir Singh <[email protected]> Cc: Paul Menage <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-04-29memcgroups: add a document describing the resource counter abstractionPavel Emelyanov1-0/+2
The resource counter is supposed to facilitate the resource accounting of arbitrary resource (and it already does this for memory controller). However, it is about to be used in other resources controllers (swap, kernel memory, networking, etc), so provide a doc describing how to work with it. This will eliminate all the possible future duplications in the appropriate controllers' docs. Fixed errors pointed out by Randy. [[email protected]: fix documentation tpyo] Signed-off-by: Pavel Emelyanov <[email protected]> Cc: Randy Dunlap <[email protected]> Cc: Balbir Singh <[email protected]> Cc: KAMEZAWA Hiroyuki <[email protected]> Cc: Li Zefan <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-04-29memcgroup: add the max_usage member on the res_counterPavel Emelyanov1-0/+14
This field is the maximal value of the usage one since the counter creation (or since the latest reset). To reset this to the usage value simply write anything to the appropriate cgroup file. Signed-off-by: Pavel Emelyanov <[email protected]> Acked-by: Balbir Singh <[email protected]> Cc: KAMEZAWA Hiroyuki <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-04-29CGroup API files: add res_counter_read_u64()Paul Menage1-1/+4
Adds a function for returning the value of a resource counter member, in a form suitable for use in a cgroup read_u64 control file method. Signed-off-by: Paul Menage <[email protected]> Cc: "Li Zefan" <[email protected]> Cc: Balbir Singh <[email protected]> Cc: Paul Jackson <[email protected]> Cc: Pavel Emelyanov <[email protected]> Cc: KAMEZAWA Hiroyuki <[email protected]> Cc: "YAMAMOTO Takashi" <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-02-07Memory controller improve user interfaceBalbir Singh1-5/+7
Change the interface to use bytes instead of pages. Page sizes can vary across platforms and configurations. A new strategy routine has been added to the resource counters infrastructure to format the data as desired. Suggested by David Rientjes, Andrew Morton and Herbert Poetzl Tested on a UML setup with the config for memory control enabled. [[email protected]: possible race fix in res_counter] Signed-off-by: Balbir Singh <[email protected]> Signed-off-by: Pavel Emelianov <[email protected]> Cc: Paul Menage <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: "Eric W. Biederman" <[email protected]> Cc: Nick Piggin <[email protected]> Cc: Kirill Korotaev <[email protected]> Cc: Herbert Poetzl <[email protected]> Cc: David Rientjes <[email protected]> Cc: Vaidyanathan Srinivasan <[email protected]> Signed-off-by: KAMEZAWA Hiroyuki <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-02-07Memory controller: add per cgroup LRU and reclaimBalbir Singh1-0/+23
Add the page_cgroup to the per cgroup LRU. The reclaim algorithm has been modified to make the isolate_lru_pages() as a pluggable component. The scan_control data structure now accepts the cgroup on behalf of which reclaims are carried out. try_to_free_pages() has been extended to become cgroup aware. [[email protected]: fix warning] [[email protected]: initialize all scan_control's isolate_pages member] [[email protected]: make do_try_to_free_pages() static] [[email protected]: memcgroup: fix try_to_free order] [[email protected]: this unlock_page_cgroup() is unnecessary] Signed-off-by: Pavel Emelianov <[email protected]> Signed-off-by: Balbir Singh <[email protected]> Cc: Paul Menage <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: "Eric W. Biederman" <[email protected]> Cc: Nick Piggin <[email protected]> Cc: Kirill Korotaev <[email protected]> Cc: Herbert Poetzl <[email protected]> Cc: David Rientjes <[email protected]> Cc: Vaidyanathan Srinivasan <[email protected]> Signed-off-by: Lee Schermerhorn <[email protected]> Signed-off-by: Hugh Dickins <[email protected]> Signed-off-by: KAMEZAWA Hiroyuki <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-02-07Memory controller: resource countersPavel Emelianov1-0/+102
With fixes from David Rientjes <[email protected]> Introduce generic structures and routines for resource accounting. Each resource accounting cgroup is supposed to aggregate it, cgroup_subsystem_state and its resource-specific members within. Signed-off-by: Pavel Emelianov <[email protected]> Signed-off-by: Balbir Singh <[email protected]> Cc: Paul Menage <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: "Eric W. Biederman" <[email protected]> Cc: Nick Piggin <[email protected]> Cc: Kirill Korotaev <[email protected]> Cc: Herbert Poetzl <[email protected]> Cc: Vaidyanathan Srinivasan <[email protected]> Signed-off-by: David Rientjes <[email protected]> Cc: Pavel Emelianov <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>