Re: [PATCH -v5][RFC]: mutex: implement adaptive spinning

From: Andrew Morton
Date: Wed Jan 07 2009 - 16:48:08 EST


On Wed, 7 Jan 2009 22:32:22 +0100
Ingo Molnar <mingo@xxxxxxx> wrote:

> > We could do the whole "oldfs = get_fs(); set_fs(KERNEL_DS); ..
> > set_fs(oldfs);" crud, but it would probably be better to just add an
> > architected accessor. Especially since it's going to generally just be a
> >
> > #define get_kernel_careful(val,p) __get_user(val,p)
> >
> > for most architectures.
> >
> > We've needed that before (and yes, we've simply mis-used __get_user() on
> > x86 before rather than add it).
>
> for the oldfs stuff we already have probe_kernel_read(). OTOH, that
> involves pagefault_disable() which is an atomic op

tisn't. pagefault_disable() is just preempt_count()+=1;barrier() ?

Am suspecting that you guys might be over-optimising this
contended-path-were-going-to-spin-anyway code?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/