perfmon2 needs hard_irq_disable() for powerpc

Sonny Rao sonny at burdell.org
Mon Nov 26 18:44:38 EST 2007


Hi, I've been reading through the perfmon2 patch for 2.6.23 and it
dawned on me that in the powerpc architecture we have the notion of
lazy-disabling of interrupts where we don't actually disable
interrupts unless we see one come in and then turn them off.  I believe
a notable exception is the performance monitor interrupt which we
allow to break into our critical sections.  This is desirable because
we want to profile those sections  and right now, no in-kernel user of
the performance monitor interrupt in powerpc does any synchronization
across cpus inside the interrupt handler (oprofile seems to use
per-cpu buffers/state for everything).  We use hard_irq_disable() when
we _really_ have to disable interrupts because we're switching out the
kernel stack, etc. 

Perfmon2 is more demanding in its synchronization requirements and it
uses spin_lock_irqsave() in the generic arch-neutral code in several
places, I think this will break on powerpc the way we're handling
things now.

I'm copying a few people to solicit opinions on how best to deal with
this.  I think it's desirable to keep the property of letting us
profile critical sections in the kernel wherever possible. So we would
need to add hard_irq_disable/enable calls to the generic code, but want to
check with you guys first.   

Sonny 




More information about the Linuxppc-dev mailing list