[PATCH 5/6] Makes procs file writable to move all threads by tgid at once
menage at google.com
Fri Jul 24 14:36:18 PDT 2009
On Fri, Jul 24, 2009 at 2:06 PM, Matt Helsley<matthltc at us.ibm.com> wrote:
>> Global rwsem: only needs one lock, but prevents all forking when a
>> write is in progress. It should be quick enough, if it's just "iterate
>> down the threadgroup list in O(n)". In the good case, fork() slows
>> down by a cache miss when taking the lock in read mode.
> I noticed your point about only one process contending for write on
> the new semaphore since cgroup_mutex is also held on the write side.
> However won't there be cacheline bouncing as lots of readers contend not
> for the read side of the lock itself but the cacheline needed to take it?
Yes, that's the "cache miss when taking the lock in read mode"
referred to by Ben in the paragraph above yours.
More information about the Containers