From: Christoph Hellwig <hch@lst.de>
To: Uday Shankar <ushankar@purestorage.com>
Cc: Costa Sapuntzakis <costa@purestorage.com>,
Randy Jennings <randyj@purestorage.com>,
Hannes Reinecke <hare@suse.de>, Sagi Grimberg <sagi@grimberg.me>,
Keith Busch <kbusch@kernel.org>, Christoph Hellwig <hch@lst.de>,
Jens Axboe <axboe@fb.com>,
linux-nvme@lists.infradead.org
Subject: Re: [PATCH v3 1/3] nvme: double KA polling frequency to avoid KATO with TBKAS on
Date: Sat, 20 May 2023 06:28:51 +0200 [thread overview]
Message-ID: <20230520042851.GD31780@lst.de> (raw)
In-Reply-To: <20230518183311.3224326-2-ushankar@purestorage.com>
On Thu, May 18, 2023 at 12:33:09PM -0600, Uday Shankar wrote:
> + *
> + * When TBKAS is on, we need to run nvme_keep_alive_work at twice this
> + * frequency, as one command completion can postpone sending a keep alive
> + * command by up to twice the delay between runs.
> */
> static void nvme_queue_keep_alive_work(struct nvme_ctrl *ctrl)
> {
> - queue_delayed_work(nvme_wq, &ctrl->ka_work, ctrl->kato * HZ / 2);
> + unsigned long delay = (ctrl->ctratt & NVME_CTRL_ATTR_TBKAS) ?
> + ctrl->kato * HZ / 4 : ctrl->kato * HZ / 2;
> + queue_delayed_work(nvme_wq, &ctrl->ka_work, delay);
Kernel coding style wants an empty line after the variable declarations.
I also find the style rather hard to read. Why not:
unsigned long delay = ctrl->kato * HZ / 2;
/*
* When using Traffic Based Keep Alive, we need to run
* nvme_keep_alive_work at twice the normal frequency, as one command
* completion can postpone sending a keep alive command by up to
* twice the delay between runs.
*/
if (ctrl->ctratt & NVME_CTRL_ATTR_TBKAS)
delay /= 2;
queue_delayed_work(nvme_wq, &ctrl->ka_work, delay);
That's not quite as dense, but relaly gets the point across to the
reader much better.
next prev parent reply other threads:[~2023-05-20 4:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-18 18:33 [PATCH v3 0/3] keepalive bugfixes Uday Shankar
2023-05-18 18:33 ` [PATCH v3 1/3] nvme: double KA polling frequency to avoid KATO with TBKAS on Uday Shankar
2023-05-20 4:28 ` Christoph Hellwig [this message]
2023-05-18 18:33 ` [PATCH v3 2/3] nvme: check IO start time when deciding to defer KA Uday Shankar
2023-05-20 4:34 ` Christoph Hellwig
2023-05-24 19:53 ` Uday Shankar
2023-05-18 18:33 ` [PATCH v3 3/3] nvme: improve handling of long keep alives Uday Shankar
2023-05-20 4:36 ` Christoph Hellwig
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=20230520042851.GD31780@lst.de \
--to=hch@lst.de \
--cc=axboe@fb.com \
--cc=costa@purestorage.com \
--cc=hare@suse.de \
--cc=kbusch@kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=randyj@purestorage.com \
--cc=sagi@grimberg.me \
--cc=ushankar@purestorage.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