linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Bart.VanAssche@sandisk.com (Bart Van Assche)
Subject: [PATCH v2] nvme-rdma: support devices with queue size < 32
Date: Tue, 11 Apr 2017 15:10:27 +0000	[thread overview]
Message-ID: <1491923426.2654.1.camel@sandisk.com> (raw)
In-Reply-To: <1807354347.364485979.1491900728245.JavaMail.zimbra@kalray.eu>

On Tue, 2017-04-11@10:52 +0200, Marta Rybczynska wrote:
> I think that we can remove the division (the modulo sig_limit). The sig_count
> is an u8 so it is really a type of variable you propose. It isn't used anywhere
> it seems so we can change the way it is used in the snippet to count until the
> signaling moment. It will give something like:
> 
> static inline nvme_rdma_queue_sig_limit(struct nvme_rdma_queue *queue)
> {
>        int sig_limit;
> 
>        /* We signal completion every queue depth/2 and also
>         * handle the case of possible device with queue_depth=1,
>         * where we would need to signal every message.
>         */
>        sig_limit = max(queue->queue_size / 2, 1);
>        queue->sig_count++;
>        if (queue->sig_count < sig_limit)
>            return 0;
>        queue->sig_count = 0;
>        return 1;
> }

Hello Marta,

Thank you for having addressed my feedback. Although this is not important, I
think it is possible to optimize the above code further as follows:
* Instead of initializing / resetting sig_count to zero, initialize it to sig_limit.
* Instead of incrementing sig_count in nvme_rdma_queue_sig_limit(), decrement it.
* Instead of comparing sig_count against sig_limit, compare it against zero.

Bart.

  parent reply	other threads:[~2017-04-11 15:10 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-10 15:12 [PATCH v2] nvme-rdma: support devices with queue size < 32 Marta Rybczynska
2017-04-10 15:16 ` Christoph Hellwig
2017-04-10 15:21   ` Marta Rybczynska
2017-04-10 15:27   ` Bart Van Assche
2017-04-10 15:31     ` hch
2017-04-10 15:32 ` Bart Van Assche
2017-04-11  8:52   ` Marta Rybczynska
2017-04-11 10:50     ` Max Gurtovoy
2017-04-11 11:04       ` Marta Rybczynska
2017-04-11 15:10     ` Bart Van Assche [this message]
2017-04-20  9:43       ` [PATCH v3] " Marta Rybczynska
2017-04-20 11:37         ` Sagi Grimberg
2017-04-20 11:43           ` Sagi Grimberg
2017-04-21  8:01             ` Marta Rybczynska
2017-05-22 18:51 ` [PATCH v2] " Christoph Hellwig
2017-05-23 15:32   ` Marta Rybczynska
2017-06-05  9:47     ` Marta Rybczynska

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=1491923426.2654.1.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).