lkml.org 
[lkml]   [2009]   [Jan]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH -v5][RFC]: mutex: implement adaptive spinning
From
Date
On Wed, 2009-01-07 at 13:58 -0800, Linus Torvalds wrote:
>
> On Wed, 7 Jan 2009, Peter Zijlstra wrote:
> >
> > Do we really have to re-do all that code every loop?
>
> No, you're right, we can just look up the cpu once. Which makes Andrew's
> argument that "probe_kernel_address()" isn't in any hot path even more
> true.

Do you need to even do that if CONFIG_DEBUG_PAGEALLOC is unset?
Something like:

#ifdef CONFIG_DEBUG_PAGEALLOC
/*
* Need to access the cpu field knowing that
* DEBUG_PAGEALLOC could have unmapped it if
* the mutex owner just released it and exited.
*/
if (probe_kernel_address(&thread->cpu, cpu))
break;
#else
cpu = thread->cpu;
#endif

Shaggy
--
David Kleikamp
IBM Linux Technology Center



\
 
 \ /
  Last update: 2009-01-07 23:57    [W:0.232 / U:0.612 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site