[PATCH] Celleb: improve htab lock

Akira Iguchi akira2.iguchi at toshiba.co.jp
Fri Feb 9 17:44:12 EST 2007


Ben-san,

> On Thu, 2007-02-08 at 21:43 +0100, Arnd Bergmann wrote:
> > On Thursday 08 February 2007 21:28, Christoph Hellwig wrote:
> > >  Also if we're sure that this is
> > > always called from process context and with irqs enabled we should
> > > be using local_irq_disable/local_irq_enable and avoid saving the
> > > flags word.
> > 
> > Right, that's what I meant, I was a little confused here.

> I prefer saving for now. We can be called whenever there is a
> flush_tlb_pending() called for flushing a pending batch and that is in
> quite a few places including deep in the context switching code, I
> wouldn't make assumption on the irq state on entry.

We prefer saving flags, too.

> I do intend at one point to move the local_irq_save/restore up a level
> though, so that all the htab functions have the same semantic of being
> called with IRQs off. Right now, the invalidate ones are sort-of an
> exception.

We need to turn IRQs off when calling htab functions if and only
if it is non-atomic, so the "pSeries with LPAR" htab function have
no spin_lock or local_irq_save/restore. We think tweaking EE bit
locally gives a way to decrease times to be IRQs off and on again
(yes, it's smallthing to compare with calling HV),
so we prefer current implementation.

We have a small patch to replace "local_irq_save" and "spin_lock"
pair to "spin_lock_irqsave". It is not necessary to apply, but if
it's possible, please apply.

Cheers,
Akira Iguchi



More information about the Linuxppc-dev mailing list