Re: [PATCH] RDMA/core: reduce IB_POLL_BATCH constant

2018-03-01 Thread Max Gurtovoy
On 2/28/2018 8:55 PM, Doug Ledford wrote: On Wed, 2018-02-28 at 11:50 +0200, Max Gurtovoy wrote: On 2/28/2018 2:21 AM, Bart Van Assche wrote: 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

Re: [PATCH] RDMA/core: reduce IB_POLL_BATCH constant

2018-03-01 Thread Max Gurtovoy
On 2/28/2018 8:55 PM, Doug Ledford wrote: On Wed, 2018-02-28 at 11:50 +0200, Max Gurtovoy wrote: On 2/28/2018 2:21 AM, Bart Van Assche wrote: 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

Re: [PATCH] RDMA/core: reduce IB_POLL_BATCH constant

2018-02-28 Thread Doug Ledford
On Wed, 2018-02-28 at 11:50 +0200, Max Gurtovoy wrote: > > On 2/28/2018 2:21 AM, Bart Van Assche wrote: > > 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

Re: [PATCH] RDMA/core: reduce IB_POLL_BATCH constant

2018-02-28 Thread Doug Ledford
On Wed, 2018-02-28 at 11:50 +0200, Max Gurtovoy wrote: > > On 2/28/2018 2:21 AM, Bart Van Assche wrote: > > 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

Re: [PATCH] RDMA/core: reduce IB_POLL_BATCH constant

2018-02-28 Thread Max Gurtovoy
On 2/28/2018 2:21 AM, Bart Van Assche wrote: 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)   { -   

Re: [PATCH] RDMA/core: reduce IB_POLL_BATCH constant

2018-02-28 Thread Max Gurtovoy
On 2/28/2018 2:21 AM, Bart Van Assche wrote: 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)   { -   

Re: [PATCH] RDMA/core: reduce IB_POLL_BATCH constant

2018-02-27 Thread Bart Van Assche
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

Re: [PATCH] RDMA/core: reduce IB_POLL_BATCH constant

2018-02-27 Thread Bart Van Assche
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

Re: [PATCH] RDMA/core: reduce IB_POLL_BATCH constant

2018-02-27 Thread Max Gurtovoy
On 2/28/2018 12:09 AM, Jason Gunthorpe wrote: On Thu, Feb 22, 2018 at 05:39:09PM +0200, Sagi Grimberg wrote: The only reason why I added this array on-stack was to allow consumers that did not use ib_alloc_cq api to call it, but that seems like a wrong decision when thinking it over again

Re: [PATCH] RDMA/core: reduce IB_POLL_BATCH constant

2018-02-27 Thread Max Gurtovoy
On 2/28/2018 12:09 AM, Jason Gunthorpe wrote: On Thu, Feb 22, 2018 at 05:39:09PM +0200, Sagi Grimberg wrote: The only reason why I added this array on-stack was to allow consumers that did not use ib_alloc_cq api to call it, but that seems like a wrong decision when thinking it over again

Re: [PATCH] RDMA/core: reduce IB_POLL_BATCH constant

2018-02-27 Thread Jason Gunthorpe
On Thu, Feb 22, 2018 at 05:39:09PM +0200, Sagi Grimberg wrote: > > >>The only reason why I added this array on-stack was to allow consumers > >>that did not use ib_alloc_cq api to call it, but that seems like a > >>wrong decision when thinking it over again (as probably these users > >>did not

Re: [PATCH] RDMA/core: reduce IB_POLL_BATCH constant

2018-02-27 Thread Jason Gunthorpe
On Thu, Feb 22, 2018 at 05:39:09PM +0200, Sagi Grimberg wrote: > > >>The only reason why I added this array on-stack was to allow consumers > >>that did not use ib_alloc_cq api to call it, but that seems like a > >>wrong decision when thinking it over again (as probably these users > >>did not

Re: [PATCH] RDMA/core: reduce IB_POLL_BATCH constant

2018-02-22 Thread Sagi Grimberg
The only reason why I added this array on-stack was to allow consumers that did not use ib_alloc_cq api to call it, but that seems like a wrong decision when thinking it over again (as probably these users did not set the wr_cqe correctly). How about we make ib_process_cq_direct use the cq wc

Re: [PATCH] RDMA/core: reduce IB_POLL_BATCH constant

2018-02-22 Thread Sagi Grimberg
The only reason why I added this array on-stack was to allow consumers that did not use ib_alloc_cq api to call it, but that seems like a wrong decision when thinking it over again (as probably these users did not set the wr_cqe correctly). How about we make ib_process_cq_direct use the cq wc

Re: [PATCH] RDMA/core: reduce IB_POLL_BATCH constant

2018-02-21 Thread Chuck Lever
> On Feb 21, 2018, at 8:44 AM, Sagi Grimberg wrote: > > >>> On Tue, 2018-02-20 at 21:59 +0100, Arnd Bergmann wrote: /* # of WCs to poll for with a single call to ib_poll_cq */ -#define IB_POLL_BATCH 16 +#define IB_POLL_BATCH

Re: [PATCH] RDMA/core: reduce IB_POLL_BATCH constant

2018-02-21 Thread Chuck Lever
> On Feb 21, 2018, at 8:44 AM, Sagi Grimberg wrote: > > >>> On Tue, 2018-02-20 at 21:59 +0100, Arnd Bergmann wrote: /* # of WCs to poll for with a single call to ib_poll_cq */ -#define IB_POLL_BATCH 16 +#define IB_POLL_BATCH 8 >>> >>>

Re: [PATCH] RDMA/core: reduce IB_POLL_BATCH constant

2018-02-21 Thread Max Gurtovoy
On 2/21/2018 3:44 PM, Sagi Grimberg wrote: On Tue, 2018-02-20 at 21:59 +0100, Arnd Bergmann wrote: /* # of WCs to poll for with a single call to ib_poll_cq */ -#define IB_POLL_BATCH    16 +#define IB_POLL_BATCH    8 The purpose of batch polling is to minimize contention on

Re: [PATCH] RDMA/core: reduce IB_POLL_BATCH constant

2018-02-21 Thread Max Gurtovoy
On 2/21/2018 3:44 PM, Sagi Grimberg wrote: On Tue, 2018-02-20 at 21:59 +0100, Arnd Bergmann wrote: /* # of WCs to poll for with a single call to ib_poll_cq */ -#define IB_POLL_BATCH    16 +#define IB_POLL_BATCH    8 The purpose of batch polling is to minimize contention on

Re: [PATCH] RDMA/core: reduce IB_POLL_BATCH constant

2018-02-21 Thread Sagi Grimberg
On Tue, 2018-02-20 at 21:59 +0100, Arnd Bergmann wrote: /* # of WCs to poll for with a single call to ib_poll_cq */ -#define IB_POLL_BATCH 16 +#define IB_POLL_BATCH 8 The purpose of batch polling is to minimize contention on the cq spinlock. Reducing the

Re: [PATCH] RDMA/core: reduce IB_POLL_BATCH constant

2018-02-21 Thread Sagi Grimberg
On Tue, 2018-02-20 at 21:59 +0100, Arnd Bergmann wrote: /* # of WCs to poll for with a single call to ib_poll_cq */ -#define IB_POLL_BATCH 16 +#define IB_POLL_BATCH 8 The purpose of batch polling is to minimize contention on the cq spinlock. Reducing the

Re: [PATCH] RDMA/core: reduce IB_POLL_BATCH constant

2018-02-21 Thread Max Gurtovoy
On 2/20/2018 11:47 PM, Chuck Lever wrote: On Feb 20, 2018, at 4:14 PM, Bart Van Assche wrote: On Tue, 2018-02-20 at 21:59 +0100, Arnd Bergmann wrote: /* # of WCs to poll for with a single call to ib_poll_cq */ -#define IB_POLL_BATCH 16 +#define

Re: [PATCH] RDMA/core: reduce IB_POLL_BATCH constant

2018-02-21 Thread Max Gurtovoy
On 2/20/2018 11:47 PM, Chuck Lever wrote: On Feb 20, 2018, at 4:14 PM, Bart Van Assche wrote: On Tue, 2018-02-20 at 21:59 +0100, Arnd Bergmann wrote: /* # of WCs to poll for with a single call to ib_poll_cq */ -#define IB_POLL_BATCH 16 +#define IB_POLL_BATCH

Re: [PATCH] RDMA/core: reduce IB_POLL_BATCH constant

2018-02-20 Thread Arnd Bergmann
nass...@sandisk.com>; linux-r...@vger.kernel.org; linux- >> ker...@vger.kernel.org >> Subject: [PATCH] RDMA/core: reduce IB_POLL_BATCH constant >> >> The ib_wc structure has grown to much that putting 16 of them on the stack >> hits >> the warning limit for da

Re: [PATCH] RDMA/core: reduce IB_POLL_BATCH constant

2018-02-20 Thread Arnd Bergmann
PM >> To: Doug Ledford ; Jason Gunthorpe >> Cc: Arnd Bergmann ; Leon Romanovsky >> ; Sagi Grimberg ; Bart Van Assche >> ; linux-r...@vger.kernel.org; linux- >> ker...@vger.kernel.org >> Subject: [PATCH] RDMA/core: reduce IB_POLL_BATCH constant >> >> The i

Re: [PATCH] RDMA/core: reduce IB_POLL_BATCH constant

2018-02-20 Thread Chuck Lever
> On Feb 20, 2018, at 4:14 PM, Bart Van Assche wrote: > > On Tue, 2018-02-20 at 21:59 +0100, Arnd Bergmann wrote: >> /* # of WCs to poll for with a single call to ib_poll_cq */ >> -#define IB_POLL_BATCH 16 >> +#define IB_POLL_BATCH

Re: [PATCH] RDMA/core: reduce IB_POLL_BATCH constant

2018-02-20 Thread Chuck Lever
> On Feb 20, 2018, at 4:14 PM, Bart Van Assche wrote: > > On Tue, 2018-02-20 at 21:59 +0100, Arnd Bergmann wrote: >> /* # of WCs to poll for with a single call to ib_poll_cq */ >> -#define IB_POLL_BATCH 16 >> +#define IB_POLL_BATCH 8 > > The purpose

Re: [PATCH] RDMA/core: reduce IB_POLL_BATCH constant

2018-02-20 Thread Bart Van Assche
On Tue, 2018-02-20 at 21:59 +0100, Arnd Bergmann wrote: > /* # of WCs to poll for with a single call to ib_poll_cq */ > -#define IB_POLL_BATCH16 > +#define IB_POLL_BATCH8 The purpose of batch polling is to minimize contention on the cq spinlock.

Re: [PATCH] RDMA/core: reduce IB_POLL_BATCH constant

2018-02-20 Thread Bart Van Assche
On Tue, 2018-02-20 at 21:59 +0100, Arnd Bergmann wrote: > /* # of WCs to poll for with a single call to ib_poll_cq */ > -#define IB_POLL_BATCH16 > +#define IB_POLL_BATCH8 The purpose of batch polling is to minimize contention on the cq spinlock.

RE: [PATCH] RDMA/core: reduce IB_POLL_BATCH constant

2018-02-20 Thread Parav Pandit
.ca> > Cc: Arnd Bergmann <a...@arndb.de>; Leon Romanovsky > <leo...@mellanox.com>; Sagi Grimberg <s...@grimberg.me>; Bart Van Assche > <bart.vanass...@sandisk.com>; linux-r...@vger.kernel.org; linux- > ker...@vger.kernel.org > Subject: [PATCH] RDMA/core

RE: [PATCH] RDMA/core: reduce IB_POLL_BATCH constant

2018-02-20 Thread Parav Pandit
> ; Sagi Grimberg ; Bart Van Assche > ; linux-r...@vger.kernel.org; linux- > ker...@vger.kernel.org > Subject: [PATCH] RDMA/core: reduce IB_POLL_BATCH constant > > The ib_wc structure has grown to much that putting 16 of them on the stack > hits > the warning li

[PATCH] RDMA/core: reduce IB_POLL_BATCH constant

2018-02-20 Thread Arnd Bergmann
The ib_wc structure has grown to much that putting 16 of them on the stack hits the warning limit for dangerous kernel stack consumption: drivers/infiniband/core/cq.c: In function 'ib_process_cq_direct': drivers/infiniband/core/cq.c:78:1: error: the frame size of 1032 bytes is larger than 1024

[PATCH] RDMA/core: reduce IB_POLL_BATCH constant

2018-02-20 Thread Arnd Bergmann
The ib_wc structure has grown to much that putting 16 of them on the stack hits the warning limit for dangerous kernel stack consumption: drivers/infiniband/core/cq.c: In function 'ib_process_cq_direct': drivers/infiniband/core/cq.c:78:1: error: the frame size of 1032 bytes is larger than 1024