[PATCH v4, under testing] nvme-rdma: support devices with queue size < 32

Bart Van Assche Bart.VanAssche at sandisk.com
Wed May 3 08:58:17 PDT 2017


On Wed, 2017-05-03 at 09:53 -0600, Jason Gunthorpe wrote:
> On Wed, May 03, 2017 at 05:19:27PM +0200, Marta Rybczynska wrote:
> 
> > > where
> > > 	queue->sig_limit = max(queue->queue_size / 2, 1);
> > 
> > I tried to avoid that because this adds a division in the fast path Bart
> > was unhappy about in v2.
> 
> The compiler switches divide/multiply by powers of two into fast bit shifts.

Hello Jason,

As far as I know the compiler only does that for compile-time constants. In
this case the divisor (max(queue_size / 2, 1)) is not a compile-time constant.

Bart.


More information about the Linux-nvme mailing list