Re: [RFC][-mm] Memory controller hierarchy support (v1)

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Balbir Singh <balbir@...>
Cc: Pavel Emelianov <xemul@...>, YAMAMOTO Takashi <yamamoto@...>, <linux-kernel@...>, <linux-mm@...>, <containers@...>, KAMEZAWA Hiroyuki <kamezawa.hiroyu@...>
Date: Saturday, April 19, 2008 - 11:49 am

On Fri, Apr 18, 2008 at 10:35 PM, Balbir Singh
<balbir@linux.vnet.ibm.com> wrote:

There's already a function, cgroup_lock(). But it would be nice to
avoid such a heavy locking here, particularly since memory allocations
can occur with cgroup_mutex held, which could lead to a nasty deadlock
if the allocation triggered reclaim.

One of the things that I've been considering was to put the
parent/child/sibling hierarchy explicitly in cgroup_subsys_state. This
would give subsystems their own copy to refer to, and could use their
own internal locking to synchronize with callbacks from cgroups that
might change the hierarchy. Cpusets could make use of this too, since
it has to traverse hierarchies sometimes.


My thoughts on this would be:

1) Never attach a first-level child's counter to its parent. As
Yamamoto points out, otherwise we end up with extra global operations
whenever any cgroup allocates or frees memory. Limiting the total
system memory used by all user processes doesn't seem to be something
that people are going to generally want to do, and if they really do
want to they can just create a non-root child and move the whole
system into that.

The one big advantage that you currently get from having all
first-level children be attached to the root is that the reclaim logic
automatically scans other groups when it reaches the top-level - but I
think that can be provided as a special-case in the reclaim traversal,
avoiding the overhead of hitting the root cgroup that we have in this
patch.

2) Always attach other children's counters to their parents - if the
user didn't want a hierarchy, they could create a flat grouping rather
than nested groupings.

Paul
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC][-mm] Memory controller hierarchy support (v1), Balbir Singh, (Sat Apr 19, 1:35 am)
Re: [RFC][-mm] Memory controller hierarchy support (v1), Paul Menage, (Sat Apr 19, 11:49 am)
Re: [RFC][-mm] Memory controller hierarchy support (v1), Paul Jackson, (Mon Apr 21, 2:33 am)
Re: [RFC][-mm] Memory controller hierarchy support (v1), Balbir Singh, (Sun Apr 20, 4:16 am)
Re: [RFC][-mm] Memory controller hierarchy support (v1), Pavel Emelyanov, (Sat Apr 19, 6:47 am)
Re: [RFC][-mm] Memory controller hierarchy support (v1), Balbir Singh, (Sun Apr 20, 3:43 am)
Re: [RFC][-mm] Memory controller hierarchy support (v1), YAMAMOTO Takashi, (Sat Apr 19, 2:56 am)
Re: [RFC][-mm] Memory controller hierarchy support (v1), Balbir Singh, (Sat Apr 19, 4:34 am)
Re: [RFC][-mm] Memory controller hierarchy support (v1), KAMEZAWA Hiroyuki, (Sun Apr 20, 8:41 pm)