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

Jason Gunthorpe
2010-11-24T22:18:45Z

On Wed, Nov 24, 2010 at 02:07:40PM -0800, Roland Dreier wrote:

> - Fixing the potential integer overflow by capping cmd.ne at some high
> but safe value (1000 say)

This breaks how userspace wants to use poll, ie if you return anything
less than what I asked for then that means there is no more work to
do. Apps make this assumption, and is a reasonable thing to
do. Otherwise apps need a dummy call to ibv_poll to avoid races.

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.

Who uses this path anyhow?

Jason