From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751853AbeB1AVI (ORCPT ); Tue, 27 Feb 2018 19:21:08 -0500 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:61211 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751304AbeB1AVF (ORCPT ); Tue, 27 Feb 2018 19:21:05 -0500 X-IronPort-AV: E=Sophos;i="5.47,403,1515427200"; d="scan'208";a="168917285" Subject: Re: [PATCH] RDMA/core: reduce IB_POLL_BATCH constant To: Max Gurtovoy , Jason Gunthorpe , Sagi Grimberg Cc: Chuck Lever , "arnd@arndb.de" , "dledford@redhat.com" , "linux-kernel@vger.kernel.org" , "leonro@mellanox.com" , "linux-rdma@vger.kernel.org" References: <20180220205924.2035765-1-arnd@arndb.de> <1519161268.3737.12.camel@wdc.com> <0f90134c-3d40-1d24-711f-e4ab32802bd8@mellanox.com> <20180227220958.GA21714@ziepe.ca> <193aaf91-c9d1-38b1-a89f-45f129ca5798@mellanox.com> From: Bart Van Assche Message-ID: Date: Tue, 27 Feb 2018 16:21:05 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <193aaf91-c9d1-38b1-a89f-45f129ca5798@mellanox.com> Content-Type: text/plain; charset=windows-1255; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/27/18 14:15, Max Gurtovoy wrote: > -static int __ib_process_cq(struct ib_cq *cq, int budget, struct ib_wc > *poll_wc) > +static int __ib_process_cq(struct ib_cq *cq, int budget, struct ib_wc > *poll_wc, > +                          int batch) >  { > -       int i, n, completed = 0; > -       struct ib_wc *wcs = poll_wc ? : cq->wc; > + int i, n, ib_poll_batch, completed = 0; > + struct ib_wc *wcs; > + > + if (poll_wc) { > + wcs = poll_wc; > + ib_poll_batch = batch; > + } else { > + wcs = cq->wc; > + ib_poll_batch = IB_POLL_BATCH; > + } Since this code has to be touched I think that we can use this opportunity to get rid of the "poll_wc ? : cq->wc" conditional and instead use what the caller passes. That will require to update all __ib_process_cq(..., ..., NULL) calls. I also propose to let the caller pass ib_poll_batch instead of figuring it out in this function. Otherwise the approach of this patch looks fine to me. Thanks, Bart.