aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorKAMEZAWA Hiroyuki <[email protected]>2009-01-07 18:07:58 -0800
committerLinus Torvalds <[email protected]>2009-01-08 08:31:05 -0800
commit27a7faa0779dd13729196c1a818c294f44bbd1ee (patch)
tree30837689bf39eb734a8917f2c912e1b8ac0c28c0 /tools/perf/scripts/python
parentc077719be8e9e6b55702117513d1b5f41d80404a (diff)
memcg: swap cgroup for remembering usage
For accounting swap, we need a record per swap entry, at least. This patch adds following function. - swap_cgroup_swapon() .... called from swapon - swap_cgroup_swapoff() ... called at the end of swapoff. - swap_cgroup_record() .... record information of swap entry. - swap_cgroup_lookup() .... lookup information of swap entry. This patch just implements "how to record information". No actual method for limit the usage of swap. These routine uses flat table to record and lookup. "wise" lookup system like radix-tree requires requires memory allocation at new records but swap-out is usually called under memory shortage (or memcg hits limit.) So, I used static allocation. (maybe dynamic allocation is not very hard but it adds additional memory allocation in memory shortage path.) Note1: In this, we use pointer to record information and this means 8bytes per swap entry. I think we can reduce this when we create "id of cgroup" in the range of 0-65535 or 0-255. Reported-by: Daisuke Nishimura <[email protected]> Reviewed-by: Daisuke Nishimura <[email protected]> Tested-by: Daisuke Nishimura <[email protected]> Reported-by: Hugh Dickins <[email protected]> Reported-by: Balbir Singh <[email protected]> Reported-by: Andrew Morton <[email protected]> Signed-off-by: KAMEZAWA Hiroyuki <[email protected]> Cc: Pavel Emelianov <[email protected]> Cc: Li Zefan <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions