Re: [patch v4] infiniband: uverbs: handle large number of entries

Jason Gunthorpe
2010-11-25T04:13:37Z

On Wed, Nov 24, 2010 at 08:05:47PM -0800, Roland Dreier wrote:

> > So if you are worried about how many times ib_poll_cq is called then
> > bound the kzalloc size and wrap the whole thing in a loop, but
> > realistically I have to think the performance trade off of
> > kzalloc/free vs calling ib_poll more often is not entirely obvious.
>
> That's true... maybe doing things one at a time but avoiding the allocs
> is the right tradeoff.

Hmm, considering your list is everything but Mellanox, maybe it makes
much more sense to push the copy_to_user down into the driver -
ie a ibv_poll_cq_user - then the driver can construct each CQ entry on
the stack and copy it to userspace, avoid the double copy, allocation
and avoid any fixed overhead of ibv_poll_cq.

A bigger change to be sure, but remember this old thread:

http://www.mail-archive.com/linux-rdma@vger.kernel.org/msg05114.html

2x improvement by removing allocs on the post path..

Jason