Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752625AbbKOJkM (ORCPT ); Sun, 15 Nov 2015 04:40:12 -0500 Received: from mail-wm0-f41.google.com ([74.125.82.41]:33113 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752381AbbKOJkH (ORCPT ); Sun, 15 Nov 2015 04:40:07 -0500 Subject: Re: [PATCH 2/9] IB: add a proper completion queue abstraction To: Christoph Hellwig , linux-rdma@vger.kernel.org References: <1447422410-20891-1-git-send-email-hch@lst.de> <1447422410-20891-3-git-send-email-hch@lst.de> Cc: bart.vanassche@sandisk.com, axboe@fb.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org From: Sagi Grimberg Message-ID: <564852F2.5080602@dev.mellanox.co.il> Date: Sun, 15 Nov 2015 11:40:02 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <1447422410-20891-3-git-send-email-hch@lst.de> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 946 Lines: 26 > +/** > + * ib_process_direct_cq - process a CQ in caller context > + * @cq: CQ to process > + * > + * This function is used to process all outstanding CQ entries on a > + * %IB_POLL_DIRECT CQ. It does not offload CQ processing to a different > + * context and does not ask from completion interrupts from the HCA. > + */ > +void ib_process_cq_direct(struct ib_cq *cq) > +{ > + WARN_ON_ONCE(cq->poll_ctx != IB_POLL_DIRECT); > + > + __ib_process_cq(cq, INT_MAX); > +} I doubt INT_MAX is useful as a budget in any use-case. it can easily hog the CPU. If the consumer is given access to poll a CQ, it must be able to provide some way to budget it. Why not expose a budget argument to the consumer? -- 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/