Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1275825 > unrolled thread
| Started by | Jason Gunthorpe <jgunthorpe@obsidianresearch.com> |
|---|---|
| First post | 2015-11-23 21:10 +0100 |
| Last post | 2015-11-23 22:00 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH 2/9] IB: add a proper completion queue abstraction Jason Gunthorpe <jgunthorpe@obsidianresearch.com> - 2015-11-23 21:10 +0100
Re: [PATCH 2/9] IB: add a proper completion queue abstraction Christoph Hellwig <hch@lst.de> - 2015-11-23 22:00 +0100
| From | Jason Gunthorpe <jgunthorpe@obsidianresearch.com> |
|---|---|
| Date | 2015-11-23 21:10 +0100 |
| Subject | Re: [PATCH 2/9] IB: add a proper completion queue abstraction |
| Message-ID | <qy5B2-6Cy-55@gated-at.bofh.it> |
On Sat, Nov 14, 2015 at 08:08:49AM +0100, Christoph Hellwig wrote:
> On Fri, Nov 13, 2015 at 11:25:13AM -0700, Jason Gunthorpe wrote:
> > For instance, like this, not fulling draining the cq and then doing:
> >
> > > + completed = __ib_process_cq(cq, budget);
> > > + if (completed < budget) {
> > > + irq_poll_complete(&cq->iop);
> > > + if (ib_req_notify_cq(cq, IB_POLL_FLAGS) > 0) {
> >
> > Doesn't seem entirely right? There is no point in calling
> > ib_req_notify_cq if the code knows there is still stuff in the CQ and
> > has already, independently, arranged for ib_poll_hander to be
> > guarenteed called.
>
> The code only calls ib_req_notify_cq if it knowns we finished earlier than
> our budget.
Okay, having now read the whole thing, I think I see the flow now. I don't
see any holes in the above, other than it is doing a bit more work
than it needs in some edges cases because it doesn't know if the CQ is
actually empty or not.
> > > + completed = __ib_process_cq(cq, IB_POLL_BUDGET_WORKQUEUE);
> > > + if (completed >= IB_POLL_BUDGET_WORKQUEUE ||
> > > + ib_req_notify_cq(cq, IB_POLL_FLAGS) > 0)
> > > + queue_work(ib_comp_wq, &cq->work);
> >
> > Same comment here..
>
> Same here - we only requeue the work item if either we processed all of
> our budget, or ib_req_notify_cq with IB_CQ_REPORT_MISSED_EVENTS told
> us that we need to poll again.
I find the if construction hard to read, but yes, it looks OK.
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Christoph Hellwig <hch@lst.de> |
|---|---|
| Date | 2015-11-23 22:00 +0100 |
| Message-ID | <qy6np-6VJ-31@gated-at.bofh.it> |
| In reply to | #1275825 |
On Mon, Nov 23, 2015 at 01:01:36PM -0700, Jason Gunthorpe wrote: > Okay, having now read the whole thing, I think I see the flow now. I don't > see any holes in the above, other than it is doing a bit more work > than it needs in some edges cases because it doesn't know if the CQ is > actually empty or not. > > > > > + completed = __ib_process_cq(cq, IB_POLL_BUDGET_WORKQUEUE); > > > > + if (completed >= IB_POLL_BUDGET_WORKQUEUE || > > > > + ib_req_notify_cq(cq, IB_POLL_FLAGS) > 0) > > > > + queue_work(ib_comp_wq, &cq->work); > > > > > > Same comment here.. > > > > Same here - we only requeue the work item if either we processed all of > > our budget, or ib_req_notify_cq with IB_CQ_REPORT_MISSED_EVENTS told > > us that we need to poll again. > > I find the if construction hard to read, but yes, it looks OK. If you're got suggestions to improve the flow please send them my way. I'm not entirely happy with it, but couldn't come up with a better idea. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web