[openib-general] Re: [PATCH] (repost) sdp: replace mlock with get_user_pages

Libor Michalek libor at topspin.com
Tue May 17 14:04:02 PDT 2005


On Sun, May 15, 2005 at 11:05:03AM +0300, Michael S. Tsirkin wrote:
> Quoting r. Libor Michalek <libor at topspin.com>:

> > +	/*
> > +	 * valid result can be 0 or 1 for complete so 
> > +	 * we ignore the value.
> > +	 */
> > +	(void)aio_complete(iocb->req, value, 0);
> >  	
> >  	if (in_atomic() || irqs_disabled()) {
> >  		INIT_WORK(&iocb->completion, do_iocb_complete, (void *)iocb);
> 
> By the way, as was already discussed here, in_atomic() may not
> catch all cases where its illegal to sleep.
> If the iocb functions get passed the socket parameter,
> the iocb can use the conn->lock.users flag to figure out that its
> OK to sleep.

  The conn->lock.users flag is not appropriate since it can be set and
it's still OK to sleep. For example it is set in numerous places where
we call kmalloc with the GFP_KERNEL flag. The conn->lock.users flag is
only modified inside a spinlock with IRQs disabled, but it can be either
value outside of that spinlock.

-Libor



More information about the general mailing list