Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754808AbbKWU5s (ORCPT ); Mon, 23 Nov 2015 15:57:48 -0500 Received: from verein.lst.de ([213.95.11.211]:52541 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750708AbbKWU5p (ORCPT ); Mon, 23 Nov 2015 15:57:45 -0500 Date: Mon, 23 Nov 2015 21:57:43 +0100 From: Christoph Hellwig To: Jason Gunthorpe Cc: Christoph Hellwig , linux-rdma@vger.kernel.org, sagig@dev.mellanox.co.il, bart.vanassche@sandisk.com, axboe@fb.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/9] IB: add a proper completion queue abstraction Message-ID: <20151123205743.GA18910@lst.de> References: <1447422410-20891-1-git-send-email-hch@lst.de> <1447422410-20891-3-git-send-email-hch@lst.de> <20151113182513.GB21808@obsidianresearch.com> <20151114070849.GD27738@lst.de> <20151123200136.GA5640@obsidianresearch.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151123200136.GA5640@obsidianresearch.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1217 Lines: 26 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/