linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/13] dax, pmem: move cpu cache maintenance to libnvdimm
@ 2017-01-20  3:50 Dan Williams
  2017-01-20  3:50 ` [PATCH 01/13] x86, dax, pmem: remove indirection around memcpy_from_pmem() Dan Williams
                   ` (13 more replies)
  0 siblings, 14 replies; 39+ messages in thread
From: Dan Williams @ 2017-01-20  3:50 UTC (permalink / raw)
  To: linux-nvdimm
  Cc: Brian Boylston, Tony Luck, Jan Kara, Toshi Kani, Mike Snitzer,
	Matthew Wilcox, linux-kernel, x86, Jeff Moyer, Christoph Hellwig,
	Jens Axboe, dm-devel, Ingo Molnar, Al Viro, H. Peter Anvin,
	linux-fsdevel, Thomas Gleixner, Linus Torvalds, Ross Zwisler

A couple weeks back, in the course of reviewing the memcpy_nocache()
proposal from Brian, Linus subtly suggested that the pmem specific
memcpy_to_pmem() routine be moved to be implemented at the driver
level [1]:

   "Quite frankly, the whole 'memcpy_nocache()' idea or (ab-)using
    copy_user_nocache() just needs to die. It's idiotic.
    
    As you point out, it's also fundamentally buggy crap.
    
    Throw it away. There is no possible way this is ever valid or
    portable. We're not going to lie and claim that it is.
    
    If some driver ends up using 'movnt' by hand, that is up to that
    *driver*. But no way in hell should we care about this one whit in
    the sense of <linux/uaccess.h>."

This feedback also dovetails with another fs/dax.c design wart of being
hard coded to assume the backing device is pmem. We call the pmem
specific copy, clear, and flush routines even if the backing device
driver is one of the other 3 dax drivers (axonram, dccssblk, or brd).
There is no reason to spend cpu cycles flushing the cache after writing
to brd, for example, since it is using volatile memory for storage.

Moreover, the pmem driver might be fronting a volatile memory range
published by the ACPI NFIT, or the platform might have arranged to flush
cpu caches on power fail. This latter capability is a feature that has
appeared in embedded storage appliances ("legacy" / pre-NFIT nvdimm
platforms).

So, this series:

1/ moves what was previously named "the pmem api" out of the global
   namespace and into "that *driver*" (libnvdimm / pmem).

2/ arranges for dax to stop abusing copy_user_nocache() and implements a
   libnvdimm-local memcpy that uses movnt

3/ makes cache maintenance optional by arranging for dax to call driver
   specific copy and flush operations only if the driver publishes them.

4/ adds a module parameter that can be used to inform libnvdimm of a
   platform-level flush-cache-on-power-fail capability.

[1]: https://lists.01.org/pipermail/linux-nvdimm/2017-January/008364.html

These patches have a build success notification from the 0day kbuild robot
and pass the libnvdimm / ndctl unit tests. I am looking to take them
through the libnvdimm tree with acks from x86, block, dm etc...

---

Dan Williams (13):
      x86, dax, pmem: remove indirection around memcpy_from_pmem()
      block, dax: introduce dax_operations
      x86, dax, pmem: introduce 'copy_from_iter' dax operation
      dax, pmem: introduce an optional 'flush' dax operation
      x86, dax: replace clear_pmem() with open coded memset + dax_ops->flush
      x86, dax, libnvdimm: move wb_cache_pmem() to libnvdimm
      x86, libnvdimm, pmem: move arch_invalidate_pmem() to libnvdimm
      x86, libnvdimm, dax: stop abusing __copy_user_nocache
      libnvdimm, pmem: implement cache bypass for all copy_from_iter() operations
      libnvdimm, pmem: fix persistence warning
      libnvdimm, nfit: enable support for volatile ranges
      libnvdimm, pmem: disable dax flushing when pmem is fronting a volatile region
      libnvdimm, pmem: disable dax flushing for 'cache flush on fail' platforms


 MAINTAINERS                      |    2 
 arch/powerpc/sysdev/axonram.c    |    6 +
 arch/x86/Kconfig                 |    1 
 arch/x86/include/asm/pmem.h      |  121 ----------------------------
 arch/x86/include/asm/string_64.h |    1 
 drivers/acpi/nfit/core.c         |   15 ++-
 drivers/block/brd.c              |    6 +
 drivers/md/dm.c                  |    6 +
 drivers/nvdimm/Kconfig           |    5 +
 drivers/nvdimm/Makefile          |    2 
 drivers/nvdimm/bus.c             |   10 +-
 drivers/nvdimm/claim.c           |    9 +-
 drivers/nvdimm/core.c            |    2 
 drivers/nvdimm/dax_devs.c        |    2 
 drivers/nvdimm/dimm_devs.c       |    4 -
 drivers/nvdimm/namespace_devs.c  |    9 +-
 drivers/nvdimm/nd-core.h         |    9 ++
 drivers/nvdimm/pfn_devs.c        |    4 -
 drivers/nvdimm/pmem.c            |   46 ++++++++---
 drivers/nvdimm/pmem.h            |   20 +++++
 drivers/nvdimm/region_devs.c     |   52 ++++++++----
 drivers/nvdimm/x86-asm.S         |   71 ++++++++++++++++
 drivers/nvdimm/x86.c             |   84 +++++++++++++++++++
 drivers/s390/block/dcssblk.c     |    6 +
 fs/block_dev.c                   |    6 +
 fs/dax.c                         |   35 +++++++-
 include/linux/blkdev.h           |   10 ++
 include/linux/libnvdimm.h        |    9 ++
 include/linux/pmem.h             |  165 --------------------------------------
 include/linux/string.h           |    8 ++
 include/linux/uio.h              |    4 +
 lib/Kconfig                      |    6 +
 lib/iov_iter.c                   |   25 ++++++
 tools/testing/nvdimm/Kbuild      |    2 
 34 files changed, 405 insertions(+), 358 deletions(-)
 delete mode 100644 arch/x86/include/asm/pmem.h
 create mode 100644 drivers/nvdimm/x86-asm.S
 create mode 100644 drivers/nvdimm/x86.c
 delete mode 100644 include/linux/pmem.h

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

end of thread, other threads:[~2017-03-28 16:27 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-20  3:50 [PATCH 00/13] dax, pmem: move cpu cache maintenance to libnvdimm Dan Williams
2017-01-20  3:50 ` [PATCH 01/13] x86, dax, pmem: remove indirection around memcpy_from_pmem() Dan Williams
2017-01-20  3:50 ` [PATCH 02/13] block, dax: introduce dax_operations Dan Williams
2017-01-20 17:28   ` Dan Williams
2017-01-20  3:50 ` [PATCH 03/13] x86, dax, pmem: introduce 'copy_from_iter' dax operation Dan Williams
2017-02-03  1:52   ` [lkp-robot] [x86, dax, pmem] 2e12109d1c: fio.write_bw_MBps -75% regression kernel test robot
2017-02-17  3:52   ` [PATCH 03/13] x86, dax, pmem: introduce 'copy_from_iter' dax operation Ross Zwisler
2017-02-17  3:56     ` Dan Williams
2017-01-20  3:50 ` [PATCH 04/13] dax, pmem: introduce an optional 'flush' " Dan Williams
2017-01-20  3:50 ` [PATCH 05/13] x86, dax: replace clear_pmem() with open coded memset + dax_ops->flush Dan Williams
2017-01-20 10:27   ` Jan Kara
2017-01-20 15:33     ` Dan Williams
2017-01-20  3:50 ` [PATCH 06/13] x86, dax, libnvdimm: move wb_cache_pmem() to libnvdimm Dan Williams
2017-01-20  3:50 ` [PATCH 07/13] x86, libnvdimm, pmem: move arch_invalidate_pmem() " Dan Williams
2017-01-20  3:50 ` [PATCH 08/13] x86, libnvdimm, dax: stop abusing __copy_user_nocache Dan Williams
2017-03-28 16:21   ` Ross Zwisler
2017-03-28 16:26     ` Dan Williams
2017-01-20  3:51 ` [PATCH 09/13] libnvdimm, pmem: implement cache bypass for all copy_from_iter() operations Dan Williams
2017-01-20  3:51 ` [PATCH 10/13] libnvdimm, pmem: fix persistence warning Dan Williams
2017-01-20  3:51 ` [PATCH 11/13] libnvdimm, nfit: enable support for volatile ranges Dan Williams
2017-01-20  3:51 ` [PATCH 12/13] libnvdimm, pmem: disable dax flushing when pmem is fronting a volatile region Dan Williams
2017-01-20  3:51 ` [PATCH 13/13] libnvdimm, pmem: disable dax flushing for 'cache flush on fail' platforms Dan Williams
     [not found] ` <148488421301.37913.12835362165895864897.stgit-p8uTFz9XbKj2zm6wflaqv1nYeNYlB/vhral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-01-21 16:28   ` [PATCH 00/13] dax, pmem: move cpu cache maintenance to libnvdimm Matthew Wilcox
2017-01-21 17:52     ` Christoph Hellwig
2017-01-22 15:43       ` Matthew Wilcox
2017-01-22 16:29         ` Christoph Hellwig
2017-01-22 18:19           ` Matthew Wilcox
2017-01-22 18:30             ` Christoph Hellwig
2017-01-22 18:39               ` Matthew Wilcox
2017-01-22 18:44                 ` Christoph Hellwig
2017-01-23  6:37                   ` Matthew Wilcox
2017-01-23  7:10                     ` Dan Williams
2017-01-23 16:00                       ` Christoph Hellwig
2017-01-23 17:14                         ` Dan Williams
2017-01-23 18:03                           ` Christoph Hellwig
2017-01-23 18:31                             ` Dan Williams
2017-01-23 15:58                     ` Christoph Hellwig
2017-01-22 17:30       ` Dan Williams
2017-01-23 16:01         ` Christoph Hellwig

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).