[PATCH/RFC 2.6.21 3/5] ehca: completion queue: remove use of do_mmap()

Nathan Lynch ntl at pobox.com
Fri Jan 12 06:40:54 EST 2007


Christoph Hellwig wrote:
> On Thu, Jan 11, 2007 at 08:08:36PM +0100, Hoang-Nam Nguyen wrote:
> 
> >  	spin_lock_irqsave(&ehca_cq_idr_lock, flags);
> >  	while (my_cq->nr_callbacks)
> >  		yield();
> 
> Calling yield is a very bad idea in general.  You should probably
> add a waitqueue that gets woken when nr_callbacks reaches zero to
> sleep effectively here.

Isn't that code outright buggy?  Calling into the scheduler with a
spinlock held and local interrupts disabled...




More information about the Linuxppc-dev mailing list