All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart.VanAssche@sandisk.com (Bart Van Assche)
Subject: [PATCH v4, under testing] nvme-rdma: support devices with queue size < 32
Date: Wed, 3 May 2017 15:58:17 +0000	[thread overview]
Message-ID: <1493827096.3901.4.camel@sandisk.com> (raw)
In-Reply-To: <20170503155316.GA14334@obsidianresearch.com>

On Wed, 2017-05-03@09:53 -0600, Jason Gunthorpe wrote:
> On Wed, May 03, 2017@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.

WARNING: multiple messages have this Message-ID (diff)
From: Bart Van Assche <Bart.VanAssche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
To: "jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org"
	<jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>,
	"mrybczyn-FNhOzJFKnXGHXe+LvDLADg@public.gmane.org"
	<mrybczyn-FNhOzJFKnXGHXe+LvDLADg@public.gmane.org>
Cc: "leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org"
	<leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	"linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org"
	<sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>,
	"hch-jcswGhMUV9g@public.gmane.org"
	<hch-jcswGhMUV9g@public.gmane.org>,
	"axboe-b10kYP2dOMg@public.gmane.org"
	<axboe-b10kYP2dOMg@public.gmane.org>,
	"linux-nvme-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-nvme-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	"maxg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org"
	<maxg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	"samuel.jones-FNhOzJFKnXGHXe+LvDLADg@public.gmane.org"
	<samuel.jones-FNhOzJFKnXGHXe+LvDLADg@public.gmane.org>,
	"keith.busch-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org"
	<keith.busch-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	"dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org"
	<dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH v4, under testing] nvme-rdma: support devices with queue size < 32
Date: Wed, 3 May 2017 15:58:17 +0000	[thread overview]
Message-ID: <1493827096.3901.4.camel@sandisk.com> (raw)
In-Reply-To: <20170503155316.GA14334-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>

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.--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2017-05-03 15:58 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-03 10:05 [PATCH v4, under testing] nvme-rdma: support devices with queue size < 32 Marta Rybczynska
2017-05-03 10:05 ` Marta Rybczynska
2017-05-03 11:17 ` Leon Romanovsky
2017-05-03 11:17   ` Leon Romanovsky
2017-05-03 15:08 ` Sagi Grimberg
2017-05-03 15:08   ` Sagi Grimberg
2017-05-03 15:19   ` Marta Rybczynska
2017-05-03 15:19     ` Marta Rybczynska
2017-05-03 15:45     ` Bart Van Assche
2017-05-03 15:45       ` Bart Van Assche
2017-05-03 15:53     ` Jason Gunthorpe
2017-05-03 15:53       ` Jason Gunthorpe
2017-05-03 15:58       ` Bart Van Assche [this message]
2017-05-03 15:58         ` Bart Van Assche
2017-05-03 16:01         ` Sagi Grimberg
2017-05-03 16:01           ` Sagi Grimberg
2017-05-03 16:27           ` Leon Romanovsky
2017-05-03 16:27             ` Leon Romanovsky
2017-05-03 16:37             ` Bart Van Assche
2017-05-03 16:37               ` Bart Van Assche
2017-05-03 16:49               ` Sagi Grimberg
2017-05-03 16:49                 ` Sagi Grimberg
2017-05-04 12:50               ` Marta Rybczynska
2017-05-04 12:50                 ` Marta Rybczynska
2017-05-17  9:02                 ` Christoph Hellwig
2017-05-17  9:02                   ` Christoph Hellwig
2017-05-17 12:50                   ` Marta Rybczynska
2017-05-17 12:50                     ` Marta Rybczynska
2017-05-03 16:17         ` Doug Ledford
2017-05-03 16:17           ` Doug Ledford
2017-05-03 16:24           ` Bart Van Assche
2017-05-03 16:24             ` Bart Van Assche
2017-05-03 19:07             ` Doug Ledford
2017-05-03 19:07               ` Doug Ledford

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1493827096.3901.4.camel@sandisk.com \
    --to=bart.vanassche@sandisk.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.