linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: linux-kernel@vger.kernel.org
Cc: axboe@kernel.dk, riel@redhat.com, linux-nvdimm@ml01.01.org,
	linux-mm@kvack.org, mgorman@suse.de,
	torvalds@linux-foundation.org, hch@lst.de
Subject: [PATCH v5 0/5] introduce __pfn_t for unmapped pfn I/O and DAX lifetime
Date: Wed, 12 Aug 2015 23:00:59 -0400	[thread overview]
Message-ID: <20150813025112.36703.21333.stgit@otcpl-skl-sds-2.jf.intel.com> (raw)

Changes since v4 [1]:

1/ Allow up to PAGE_SHIFT bits in PFN_ flags.  Previously the __pfn_t
   value was a union with a 'struct page *', but now __pfn_t_to_page()
   internally does a pfn_to_page() instead of type-punning the value.
   (Linus, Matthew)

2/ Move the definition to include/linux/mm.h and squash the
   kmap_atomic_pfn_t() definition into the same patch. (Christoph)

3/ Kill dax_get_pfn().  Now replaced with dax_map_bh() (Matthew)

4/ The scatterlist cleanup patches are moved to their own series being
   carried by Christoph.

[1]: https://lists.01.org/pipermail/linux-nvdimm/2015-June/001094.html

---

We want persistent memory to have 4 modes of access:

1/ Block device: persistent memory treated as a ram disk (done)

2/ DAX: userspace mmap (done)

3/ Kernel "page-less". (this series)

4/ Kernel and userspace references to page-mapped persistent memory
   (future series)

The "kernel 'page-less'" case leverages the fact that a 'struct page'
object is not necessarily required for describing a DMA transfer from a
device to a persistent memory address.  A pfn will do, but code needs to
be careful to not perform a pfn_to_page() operation on unmapped
persistent memory. The __pfn_t type enforces that safety and
kmap_atomic_pfn_t() covers cases where the I/O stack needs to touch the
buffer on its way to the low-level-device-driver (i.e. current usages of
kmap_atomic() in the block-layer).

A subsequent patch series will add struct page coverage for persistent,
"device", memory.

We also use kmap_atomic_pfn_t() to solve races of pmem driver unbind vs
usage in DAX. rcu_read_lock() protects the driver from unbinding while a
mapping is held.

---

Christoph Hellwig (1):
      mm: move __phys_to_pfn and __pfn_to_phys to asm/generic/memory_model.h

Dan Williams (4):
      allow mapping page-less memremaped areas into KVA
      dax: drop size parameter to ->direct_access()
      dax: fix mapping lifetime handling, convert to __pfn_t + kmap_atomic_pfn_t()
      scatterlist: convert to __pfn_t


 arch/arm/include/asm/memory.h       |    6 --
 arch/arm64/include/asm/memory.h     |    6 --
 arch/powerpc/platforms/Kconfig      |    1 
 arch/powerpc/sysdev/axonram.c       |   24 +++++--
 arch/unicore32/include/asm/memory.h |    6 --
 drivers/block/brd.c                 |    9 +--
 drivers/nvdimm/Kconfig              |    1 
 drivers/nvdimm/pmem.c               |   24 ++++---
 drivers/s390/block/Kconfig          |    1 
 drivers/s390/block/dcssblk.c        |   23 ++++++-
 fs/Kconfig                          |    1 
 fs/block_dev.c                      |    4 +
 fs/dax.c                            |   79 +++++++++++++++++-------
 include/asm-generic/memory_model.h  |    6 ++
 include/linux/blkdev.h              |    7 +-
 include/linux/kmap_pfn.h            |   31 +++++++++
 include/linux/mm.h                  |   78 +++++++++++++++++++++++
 include/linux/scatterlist.h         |  111 +++++++++++++++++++++++----------
 mm/Kconfig                          |    3 +
 mm/Makefile                         |    1 
 mm/kmap_pfn.c                       |  117 +++++++++++++++++++++++++++++++++++
 samples/kfifo/dma-example.c         |    8 +-
 22 files changed, 435 insertions(+), 112 deletions(-)
 create mode 100644 include/linux/kmap_pfn.h
 create mode 100644 mm/kmap_pfn.c

             reply	other threads:[~2015-08-13  3:06 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-13  3:00 Dan Williams [this message]
2015-08-13  3:01 ` [PATCH v5 1/5] mm: move __phys_to_pfn and __pfn_to_phys to asm/generic/memory_model.h Dan Williams
2015-08-13  3:01 ` [PATCH v5 2/5] allow mapping page-less memremaped areas into KVA Dan Williams
2015-08-13  5:58   ` Boaz Harrosh
2015-08-13 12:57     ` Dan Williams
2015-08-13 13:23       ` Boaz Harrosh
2015-08-13 14:41         ` Christoph Hellwig
2015-08-13 15:01           ` Boaz Harrosh
2015-08-13 14:37     ` Christoph Hellwig
2015-08-13 14:48       ` Boaz Harrosh
2015-08-13 15:29         ` Boaz Harrosh
2015-08-13 17:37         ` Dave Hansen
2015-08-13 17:35   ` Matthew Wilcox
2015-08-13 18:15     ` Dan Williams
2015-08-13  3:01 ` [PATCH v5 3/5] dax: drop size parameter to ->direct_access() Dan Williams
2015-08-13  3:01 ` [PATCH v5 4/5] dax: fix mapping lifetime handling, convert to __pfn_t + kmap_atomic_pfn_t() Dan Williams
2015-08-13  6:26   ` Boaz Harrosh
2015-08-13 15:21     ` Dan Williams
2015-08-13 16:34       ` Boaz Harrosh
2015-08-13 18:51         ` Dan Williams
2015-08-13  3:01 ` [PATCH v5 5/5] scatterlist: convert to __pfn_t Dan Williams

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=20150813025112.36703.21333.stgit@otcpl-skl-sds-2.jf.intel.com \
    --to=dan.j.williams@intel.com \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-nvdimm@ml01.01.org \
    --cc=mgorman@suse.de \
    --cc=riel@redhat.com \
    --cc=torvalds@linux-foundation.org \
    /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 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).