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 2/3] nvme: check IO start time when deciding to defer KA
Date: Sat, 20 May 2023 06:34:22 +0200 [thread overview]
Message-ID: <20230520043422.GE31780@lst.de> (raw)
In-Reply-To: <20230518183311.3224326-3-ushankar@purestorage.com>
On Thu, May 18, 2023 at 12:33:10PM -0600, Uday Shankar wrote:
> + WRITE_ONCE(ctrl->ka_last_check_time, jiffies);
> + smp_wmb();
> ctrl->comp_seen = false;
> spin_lock_irqsave(&ctrl->lock, flags);
> if (ctrl->state == NVME_CTRL_LIVE ||
> @@ -1206,6 +1215,9 @@ static void nvme_keep_alive_work(struct work_struct *work)
> bool comp_seen = ctrl->comp_seen;
> struct request *rq;
>
> + WRITE_ONCE(ctrl->ka_last_check_time, jiffies);
> + smp_wmb();
WRITE_ONCE only works when paired with READ_ONCE on the read size,
which I don't ee here.
smp_wmb always pairs with smp_rmb, which I don't see here either. We
also require documentation explaining the pairing because it tends to
be non-obvious (unlike READ_ONCE/WRITE_ONCE that are paired to a
variable). I also can't really see a reason for the barrier here,
but the comment would be the thing to convince the reviewer.
next prev parent reply other threads:[~2023-05-20 4:34 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
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 [this message]
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=20230520043422.GE31780@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