From: Dmitry Bogdanov <d.bogdanov@yadro.com>
To: Guixin Liu <kanie@linux.alibaba.com>
Cc: <hch@lst.de>, <sagi@grimberg.me>, <kch@nvidia.com>,
<linux-nvme@lists.infradead.org>
Subject: Re: [PATCH v9 1/1] nvmet: support reservation feature
Date: Tue, 24 Sep 2024 15:57:50 +0300 [thread overview]
Message-ID: <20240924125750.GG22571@yadro.com> (raw)
In-Reply-To: <68e3d62e-0f35-4b1b-9d46-b8e7ff0110b5@linux.alibaba.com>
On Tue, Sep 24, 2024 at 05:45:12PM +0800, Guixin Liu wrote:
> 在 2024/9/24 16:24, Dmitry Bogdanov 写道:
> > > I take a look again, if we set self new holder before call
> > > nvmet_pr_unreg_all_others_by_prkey(), the
> > > nvmet_pr_unreg_all_others_by_prkey() will
> > >
> > > not unregister self, so this will not goto nvmet_pr_unregister_one()'s
> > > calling nvmet_pr_resv_released().
> > Yes, and this is a reason not to try to fix non-atomicity (anothter my
> > comment) by setting new holder before unregistering.
> >
> > Regarding this place, here nvmet_pr_resv_released should be called for
> > original_rtype !=*_REG_ONLY with a note that _REG_ONLY handled in nvmet_pr_unregister_one.
> >
> > Please, do not take my suggestions "how to fix" as a direct order, it's
> > just suggestion.
> >
> I'm a little confused, if we dont set new holder before unregistering,
> how do we fix the non-atomicity problem?
>
> My opinion is that setting current host to holder first can not only
> make sure that during unregistering other host can not access, but also
> ensure that nvmet_pr_unregister_one will not unregiter the new holder(In
> nvmet_pr_unreg_all_others_by_prkey, I exclude current host),
> so that we dont need to worry about doule call nvmet_pr_resv_released.
I didnot mean that that will not fix the non-atomicity.
I was worrying that in that case you will miss the existing logic for the
changing the reservation - that reservation released notification in nvmet_pr_unregister_one.
But, looking into that now I see that keeping nvmet_pr_resv_released()
here and setting the holder before unregistring others will actualy
solve both my comments.
BR,
Dmitry
prev parent reply other threads:[~2024-09-24 12:59 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-23 9:47 [PATCH v9 0/1] Implement the NVMe reservation feature Guixin Liu
2024-09-23 9:47 ` [PATCH v9 1/1] nvmet: support " Guixin Liu
2024-09-23 16:32 ` Dmitry Bogdanov
2024-09-24 2:49 ` Guixin Liu
2024-09-24 5:54 ` Dmitry Bogdanov
2024-09-24 6:18 ` Guixin Liu
2024-09-24 6:38 ` Guixin Liu
2024-09-24 8:24 ` Dmitry Bogdanov
2024-09-24 9:45 ` Guixin Liu
2024-09-24 12:57 ` Dmitry Bogdanov [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=20240924125750.GG22571@yadro.com \
--to=d.bogdanov@yadro.com \
--cc=hch@lst.de \
--cc=kanie@linux.alibaba.com \
--cc=kch@nvidia.com \
--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.