[openib-general] Re: [PATCH] (repost) sdp: replace mlock with get_user_pages
Michael S. Tsirkin
mst at mellanox.co.il
Tue May 17 15:14:07 PDT 2005
Quoting r. Libor Michalek <libor at topspin.com>:
> Subject: Re: [PATCH] (repost) sdp: replace mlock with get_user_pages
>
> 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
>
SDP_CONN_LOCK_IRQ does not set the users flag.
If users is set this means that the socket was locked with
sdp_conn_lock, which in turn means we are not in interrupt.
Isnt that right?
--
MST - Michael S. Tsirkin
More information about the general
mailing list