lkml.org 
[lkml]   [2008]   [May]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 08 of 11] anon-vma-rwsem
On Wed, 14 May 2008, Linus Torvalds wrote:

> One thing to realize is that most of the time (read: pretty much *always*)
> when we have the problem of wanting to sleep inside a spinlock, the
> solution is actually to just move the sleeping to outside the lock, and
> then have something else that serializes things.

The problem is that the code in rmap.c try_to_umap() and friends loops
over reverse maps after taking a spinlock. The mm_struct is only known
after the rmap has been acccessed. This means *inside* the spinlock.

That is why I tried to convert the locks to scan the revese maps to
semaphores. If that is done then one can indeed do the callouts outside of
atomic contexts.

> Can it be done? I don't know. But I do know that I'm unlikely to accept a
> noticeable slowdown in some very core code for a case that affects about
> 0.00001% of the population. In other words, I think you *have* to do it.

With larger number of processor semaphores make a lot of sense since the
holdoff times on spinlocks will increase. If we go to sleep then the
processor can do something useful instead of hogging a cacheline.

A rw lock there can also increase concurrency during reclaim espcially if
the anon_vma chains and the number of address spaces mapping a page is
high.



\
 
 \ /
  Last update: 2008-05-14 19:59    [from the cache]
©2003-2011 Jasper Spaans