lkml.org 
[lkml]   [2008]   [Mar]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC][2/3] Account and control virtual address space allocations
From
Date
On Sun, 2008-03-16 at 23:00 +0530, Balbir Singh wrote:
> @@ -787,6 +788,8 @@ static int ptrace_bts_realloc(struct tas
> current->mm->total_vm -= old_size;
> current->mm->locked_vm -= old_size;
>
> + mem_cgroup_update_as(current->mm, -old_size);
> +
> if (size == 0)
> goto out;

I think splattering these things all over is probably a bad idea.

If you're going to do this, I think you need a couple of phases.

1. update the vm_(un)acct_memory() functions to take an mm
2. start using them (or some other abstracted functions in place)
3. update the new functions for cgroups

It's a bit non-obvious why you do the mem_cgroup_update_as() calls in
the places that you do from context.

Having some other vm-abstracted functions will also keep you from
splattering mem_cgroup_update_as() across the tree. That's a pretty bad
name. :) ...update_mapped() or ...update_vm() might be a wee bit
better.

-- Dave



\
 
 \ /
  Last update: 2008-03-17 17:55    [W:0.101 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site