lkml.org 
[lkml]   [2005]   [Feb]   [23]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
FromDavid Howells <>
SubjectRe: [PATCH/RFC] Futex mmap_sem deadlock
DateWed, 23 Feb 2005 18:44:56 +0000
Olof Johansson <olof@austin.ibm.com> wrote:

> > Alternately, you could just have do_page_fault() do:
> > 
> > 	while (!down_read_trylock(&current->mm->mmap_sem))
> > 		continue;
> > 
> > However, note that this can suffer from starvation due to a never ending
> > flow of mixed write-locks and read-locks on other CPUs. Unlikely, true,
> > but not impossible.
> 
> How can this help? 
> 
> The semaphore is held for reading by the thread that faulted in
> futex_wait() -> get_user(), so no writers will be let through. Until the
> writer has been let through, the down_read_trylock will never succeed
> either. No forward progress can be made even with the above loop.

You're right. The "writers" would have to spin instead.

David
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:10    [from the cache]
©2003-2008