> -----Original Message-----
> From: Weiny, Ira
> Sent: Wednesday, October 28, 2015 11:40 AM
> 
> What about using the gfp_mask through this stack?

Can be done.

> 
> I think you need to split ib_nl_send_msg into "create message" and "send
> message".  Then don't add the message to the list unless it is ready to go.
> Then you can get rid of the code below which is removing it on error.

Even if you split it, you can't get rid of the code unless you hold the 
spinlock because the sending could fail.

> 
> > +   spin_lock_irqsave(&ib_nl_request_lock, flags);
> 
> Do we still need the spin lock?

Yes: to remove it from the list in case of failure or schedule the delayed work.
> 
> >     if (ret <= 0) {
> >             ret = -EIO;
> > -           goto request_out;
> > +           /* Remove the request */
> > +           list_del(&query->list);
> 
> Don't need to do this if we split ib_nl_send_msg.

See above.

Kaike
> 
> Ira
> 
> >     } else {
> >             ret = 0;
> > +           /* Start the timeout if this is the only request */
> > +           if (ib_nl_request_list.next == &query->list)
> > +                   queue_delayed_work(ib_nl_wq, &ib_nl_timed_work,
> delay);
> >     }
> > -
> > -   delay = msecs_to_jiffies(sa_local_svc_timeout_ms);
> > -   query->timeout = delay + jiffies;
> > -   list_add_tail(&query->list, &ib_nl_request_list);
> > -   /* Start the timeout if this is the only request */
> > -   if (ib_nl_request_list.next == &query->list)
> > -           queue_delayed_work(ib_nl_wq, &ib_nl_timed_work, delay);
> > -
> > -request_out:
> >     spin_unlock_irqrestore(&ib_nl_request_lock, flags);
> >
> >     return ret;
> > --
> > 1.7.1
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-rdma"
> > in the body of a message to [email protected] More
> majordomo
> > info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to