linux-nvdimm.lists.01.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] cdev: Generic shutdown handling
@ 2021-01-20 19:38 Dan Williams
  2021-01-20 19:38 ` [PATCH 1/3] cdev: Finish the cdev api with queued mode support Dan Williams
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Dan Williams @ 2021-01-20 19:38 UTC (permalink / raw)
  To: gregkh
  Cc: Alexandre Belloni, Alexander Viro, logang, Hans Verkuil,
	linux-kernel, linux-nvdimm

After reviewing driver submissions with new cdev + ioctl usages one
common stumbling block is coordinating the shutdown of the ioctl path,
or other file operations, at driver ->remove() time. While cdev_del()
guarantees that no new file descriptors will be established, operations
on existing file descriptors can proceed indefinitely.

Given the observation that the kernel spends the resources for a percpu_ref
per request_queue shared with all block_devices on a gendisk, do the
same for all the cdev instances that share the same
cdev_add()-to-cdev_del() lifetime.

With this in place cdev_del() not only guarantees 'no new opens', but it
also guarantees 'no new operations invocations' and 'all threads running
in an operation handler have exited that handler'.

As a proof point of the way driver implementations open-code around this
gap in the api the libnvdimm ioctl path is reworked with a result of:

    4 files changed, 101 insertions(+), 153 deletions(-)

---

Dan Williams (3):
      cdev: Finish the cdev api with queued mode support
      libnvdimm/ida: Switch to non-deprecated ida helpers
      libnvdimm/ioctl: Switch to cdev_register_queued()


 drivers/nvdimm/btt_devs.c       |    6 +
 drivers/nvdimm/bus.c            |  177 +++++++++------------------------------
 drivers/nvdimm/core.c           |   14 ++-
 drivers/nvdimm/dax_devs.c       |    4 -
 drivers/nvdimm/dimm_devs.c      |   53 +++++++++---
 drivers/nvdimm/namespace_devs.c |   14 +--
 drivers/nvdimm/nd-core.h        |   14 ++-
 drivers/nvdimm/pfn_devs.c       |    4 -
 fs/char_dev.c                   |  108 ++++++++++++++++++++++--
 include/linux/cdev.h            |   21 ++++-
 10 files changed, 238 insertions(+), 177 deletions(-)
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2021-01-30  1:59 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-20 19:38 [PATCH 0/3] cdev: Generic shutdown handling Dan Williams
2021-01-20 19:38 ` [PATCH 1/3] cdev: Finish the cdev api with queued mode support Dan Williams
2021-01-20 19:46   ` Christoph Hellwig
2021-01-20 20:20     ` Dan Williams
2021-01-20 21:39       ` Dan Williams
2021-01-20 19:50   ` Logan Gunthorpe
2021-01-20 20:38     ` Dan Williams
2021-01-21  8:13   ` Greg KH
2021-01-21 17:50     ` Dan Williams
2021-01-20 19:39 ` [PATCH 2/3] libnvdimm/ida: Switch to non-deprecated ida helpers Dan Williams
2021-01-20 19:39 ` [PATCH 3/3] libnvdimm/ioctl: Switch to cdev_register_queued() Dan Williams
2021-01-21  8:15   ` Greg KH
2021-01-21 17:02     ` Dan Williams
2021-01-30  1:59 ` [PATCH 0/3] cdev: Generic shutdown handling Dan Williams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).