From: Nilay Shroff <nilay@linux.ibm.com>
To: Keith Busch <kbusch@kernel.org>
Cc: linux-nvme@lists.infradead.org, hch@lst.de, sagi@grimberg.me,
axboe@fb.com, chaitanyak@nvidia.com, dlemoal@kernel.org,
gjoyce@linux.ibm.com
Subject: Re: [PATCH 3/3] nvme: use helper nvme_ctrl_state in nvme_keep_alive_end_io function
Date: Sun, 3 Nov 2024 23:24:16 +0530 [thread overview]
Message-ID: <f35e7094-9f21-4b9f-9f05-1689ae995fbc@linux.ibm.com> (raw)
In-Reply-To: <ZyUoa33hvwEybcRf@kbusch-mbp.dhcp.thefacebook.com>
On 11/2/24 00:43, Keith Busch wrote:
> On Wed, Oct 30, 2024 at 11:37:15AM +0530, Nilay Shroff wrote:
>> On 10/29/24 20:31, Keith Busch wrote:
>>>> @@ -1296,10 +1296,9 @@ static enum rq_end_io_ret nvme_keep_alive_end_io(struct request *rq,
>>>> blk_status_t status)
>>>> {
>>>> struct nvme_ctrl *ctrl = rq->end_io_data;
>>>> - unsigned long flags;
>>>> - bool startka = false;
>>>> unsigned long rtt = jiffies - (rq->deadline - rq->timeout);
>>>> unsigned long delay = nvme_keep_alive_work_period(ctrl);
>>>> + enum nvme_ctrl_state state = nvme_ctrl_state(ctrl->state);
>>>>
>>>> /*
>>>> * Subtract off the keepalive RTT so nvme_keep_alive_work runs
>>>> @@ -1324,13 +1323,9 @@ static enum rq_end_io_ret nvme_keep_alive_end_io(struct request *rq,
>>>>
>>>> ctrl->ka_last_check_time = jiffies;
>>>> ctrl->comp_seen = false;
>>>> - spin_lock_irqsave(&ctrl->lock, flags);
>>>> - if (ctrl->state == NVME_CTRL_LIVE ||
>>>> - ctrl->state == NVME_CTRL_CONNECTING)
>>>> - startka = true;
>>>> - spin_unlock_irqrestore(&ctrl->lock, flags);
>>>> - if (startka)
>>>> + if (state == NVME_CTRL_LIVE || state == NVME_CTRL_CONNECTING)
>>>> queue_delayed_work(nvme_wq, &ctrl->ka_work, delay);
>>>> +
>>>> return RQ_END_IO_NONE;
>>>> }
>>>
>>> This restores what you had in the reverted patch, which was a
>>> significant portion of the diff stat. If we're keeping this chunk, maybe
>>> a full revert isn't necessary, and we can squash the series to just one
>>> fixing commit.
>>>
>> This doesn't exactly restore what was reverted in the patch. If you
>> closely look at the reverted patch then you would find that we reverted
>> the nvme_keep_alive_finish function which is not exactly same as
>> nvme_keep_alive_end_io function. We renamed nvme_keep_alive_end_io()
>> to nvme_keep_alive_finish() for the upstream patch.
>>
>> So the revert patch restores nvme_keep_alive_end_io function and also
>> restores the nvme_keep_alive_work changes. Then the current patch in this
>> patchset, actually works upon nvme_keep_alive_end_io function.
>
> Not the whole thing. I'm just talking about the parts I've hightlighted
> here. Squashing this series doesn't show any changes to the state check.
>
Ok got it! I will squash these parts in the next revision of the patchset.
Thanks,
--Nilay
prev parent reply other threads:[~2024-11-03 17:54 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-27 17:02 [PATCH 0/3] nvme: fix system fault observed while shutting down controller Nilay Shroff
2024-10-27 17:02 ` [PATCH 1/3] Revert "nvme: make keep-alive synchronous operation" Nilay Shroff
2024-10-27 22:05 ` Sagi Grimberg
2024-10-29 6:48 ` Ming Lei
2024-10-29 12:46 ` Nilay Shroff
2024-10-27 17:02 ` [PATCH 2/3] nvme-fabrics: fix kernel crash while shutting down controller Nilay Shroff
2024-10-27 22:05 ` Sagi Grimberg
2024-10-29 7:23 ` Ming Lei
2024-10-29 12:40 ` Nilay Shroff
2024-10-30 2:20 ` Ming Lei
2024-10-30 10:38 ` Nilay Shroff
2024-10-30 12:51 ` Ming Lei
2024-10-31 10:10 ` Nilay Shroff
2024-10-27 17:02 ` [PATCH 3/3] nvme: use helper nvme_ctrl_state in nvme_keep_alive_end_io function Nilay Shroff
2024-10-27 22:07 ` Sagi Grimberg
2024-10-28 4:43 ` Nilay Shroff
2024-10-29 14:58 ` Keith Busch
2024-10-29 15:01 ` Keith Busch
2024-10-30 6:07 ` Nilay Shroff
2024-11-01 19:13 ` Keith Busch
2024-11-03 17:54 ` Nilay Shroff [this message]
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=f35e7094-9f21-4b9f-9f05-1689ae995fbc@linux.ibm.com \
--to=nilay@linux.ibm.com \
--cc=axboe@fb.com \
--cc=chaitanyak@nvidia.com \
--cc=dlemoal@kernel.org \
--cc=gjoyce@linux.ibm.com \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
/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.