All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony Iliopoulos <ailiop@suse.com>
To: Sagi Grimberg <sagi@grimberg.me>
Cc: linux-nvme@lists.infradead.org,
	Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>,
	hch@lst.de
Subject: Re: [PATCH V2 2/2] nvmet: add per ns thread to generate AEN
Date: Wed, 8 Apr 2020 11:55:00 +0200	[thread overview]
Message-ID: <20200408095500.GD1329@technoir> (raw)
In-Reply-To: <5e54afaa-7de5-a89e-5740-88df15c52bba@grimberg.me>

On Tue, Apr 07, 2020 at 10:33:07PM -0700, Sagi Grimberg wrote:
> 
> 
> On 4/7/20 9:16 PM, Chaitanya Kulkarni wrote:
> > The change of size detection on the target should generate the AEN to
> > the host. Right now there is no mechanism that allows us to add
> > callbacks for the block and file backend so that we will get the
> > notification for change of the size for block device and file backend.
> > This patch adds a simple per namespace thread that checks for the size
> > change and generates AEN when needed.
> 
> kthread? per ns?! I really don't think this is the way to go Chaitanya..
> 
> I'd suggest to expose a revalidate configfs attribute and have nvmetcli
> install a udev rule that triggers a write to this attribute. Balbir
> already got the udev notification for disk resize (see
> set_capacity_revalidate_and_notify).

So in the original design I had assumed that the burden of AEN
generation falls on userspace, given that the resizing of either a block
device or a file is something that userspace would initiate anyway. As
such, the same process could simply issue a nvme rescan ioctl to effect
the capacity changes (this is why in the original patch I had wired up
revalidate with identify).

With the udev notification patchset in place one could trigger the
rescan for bdev-backed targets (e.g. do a nvme ns-rescan, or toggle
the existing nvmet ns enable configfs attr to induce the change). Some
revalidation actions will necessarily remain in userspace, e.g. in
blktests where loopback bdev is used, it requires a LOOP_SET_CAPACITY
ioctl to reflect the changes (losetup -c).

For file-backed targets, userspace may leverage inotify to achieve the
same. Otherwise a size change notifier would be required to trigger a
rescan (e.g. see fs/attr.c:notify_change()). The issue though here is
that there is no immediate way to associate a filp to a namespace, which
means that the handler would need to iterate all controllers and every
namespace to match it - not very nice, and probably isn't worth the
complexity.

_______________________________________________
linux-nvme mailing list
linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

  parent reply	other threads:[~2020-04-08  9:55 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-08  4:16 [PATCH V2 0/2] nvmet: add revalidate support Chaitanya Kulkarni
2020-04-08  4:16 ` [PATCH V2 1/2] nvmet: add ns revalidation support Chaitanya Kulkarni
2020-04-08  4:16 ` [PATCH V2 2/2] nvmet: add per ns thread to generate AEN Chaitanya Kulkarni
2020-04-08  5:33   ` Sagi Grimberg
2020-04-08  5:43     ` Chaitanya Kulkarni
2020-04-08  5:48       ` Chaitanya Kulkarni
2020-04-08  5:55       ` Sagi Grimberg
2020-04-08 15:12         ` Chaitanya Kulkarni
2020-04-10  4:07           ` Sagi Grimberg
2020-04-20  0:13             ` Chaitanya Kulkarni
2020-04-08  9:55     ` Anthony Iliopoulos [this message]
2020-04-08 15:25       ` Chaitanya Kulkarni
2020-04-08 17:08         ` Anthony Iliopoulos
2020-04-08 23:28           ` Chaitanya Kulkarni
2020-04-09  9:41             ` Anthony Iliopoulos
2020-04-20  0:20               ` Chaitanya Kulkarni
2020-04-08  5:24 ` [PATCH V2 0/2] nvmet: add revalidate support Chaitanya Kulkarni

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=20200408095500.GD1329@technoir \
    --to=ailiop@suse.com \
    --cc=chaitanya.kulkarni@wdc.com \
    --cc=hch@lst.de \
    --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.