linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: akpm@linux-foundation.org
Cc: Inki Dae <inki.dae@samsung.com>, Jan Kara <jack@suse.cz>,
	Joonyoung Shim <jy0922.shim@samsung.com>,
	linux-nvdimm@lists.01.org, linux-rdma@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Seung-Woo Kim <sw0312.kim@samsung.com>,
	Jeff Moyer <jmoyer@redhat.com>,
	stable@vger.kernel.org, Hal Rosenstock <hal.rosenstock@gmail.com>,
	Jason Gunthorpe <jgunthorpe@obsidianresearch.com>,
	linux-mm@kvack.org, Doug Ledford <dledford@redhat.com>,
	Mel Gorman <mgorman@suse.de>,
	Ross Zwisler <ross.zwisler@linux.intel.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Sean Hefty <sean.hefty@intel.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	hch@lst.de, Vlastimil Babka <vbabka@suse.cz>,
	linux-media@vger.kernel.org
Subject: [PATCH v3 0/4] introduce get_user_pages_longterm()
Date: Wed, 29 Nov 2017 10:05:29 -0800	[thread overview]
Message-ID: <151197872943.26211.6551382719053304996.stgit@dwillia2-desk3.amr.corp.intel.com> (raw)

Changes since v2 [1]:
* Add a comment for the vma_is_fsdax() check in get_vaddr_frames() (Jan)
* Collect Jan's Reviewed-by.
* Rebased on v4.15-rc1

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

The summary text below is unchanged from v2.

---

Andrew,

Here is a new get_user_pages api for cases where a driver intends to
keep an elevated page count indefinitely. This is distinct from usages
like iov_iter_get_pages where the elevated page counts are transient.
The iov_iter_get_pages cases immediately turn around and submit the
pages to a device driver which will put_page when the i/o operation
completes (under kernel control).

In the longterm case userspace is responsible for dropping the page
reference at some undefined point in the future. This is untenable for
filesystem-dax case where the filesystem is in control of the lifetime
of the block / page and needs reasonable limits on how long it can wait
for pages in a mapping to become idle.

Fixing filesystems to actually wait for dax pages to be idle before
blocks from a truncate/hole-punch operation are repurposed is saved for
a later patch series.

Also, allowing longterm registration of dax mappings is a future patch
series that introduces a "map with lease" semantic where the kernel can
revoke a lease and force userspace to drop its page references.

I have also tagged these for -stable to purposely break cases that might
assume that longterm memory registrations for filesystem-dax mappings
were supported by the kernel. The behavior regression this policy change
implies is one of the reasons we maintain the "dax enabled. Warning:
EXPERIMENTAL, use at your own risk" notification when mounting a
filesystem in dax mode.

It is worth noting the device-dax interface does not suffer the same
constraints since it does not support file space management operations
like hole-punch.

---

Dan Williams (4):
      mm: introduce get_user_pages_longterm
      mm: fail get_vaddr_frames() for filesystem-dax mappings
      [media] v4l2: disable filesystem-dax mapping support
      IB/core: disable memory registration of fileystem-dax vmas


 drivers/infiniband/core/umem.c            |    2 -
 drivers/media/v4l2-core/videobuf-dma-sg.c |    5 +-
 include/linux/fs.h                        |   14 ++++++
 include/linux/mm.h                        |   13 ++++++
 mm/frame_vector.c                         |   12 +++++
 mm/gup.c                                  |   64 +++++++++++++++++++++++++++++
 6 files changed, 107 insertions(+), 3 deletions(-)

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

             reply	other threads:[~2017-11-29 18:13 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-29 18:05 Dan Williams [this message]
2017-11-29 18:05 ` [PATCH v3 1/4] mm: introduce get_user_pages_longterm Dan Williams
2017-11-30  9:53   ` Michal Hocko
2017-11-30 16:39     ` Dan Williams
2017-11-30 17:42       ` Michal Hocko
2017-11-30 18:03         ` Dan Williams
2017-11-30 18:17           ` Michal Hocko
2017-11-30 18:32             ` Dan Williams
2017-11-30 19:01               ` Jason Gunthorpe
2017-12-01 10:12                 ` Michal Hocko
2017-12-01 16:02                   ` Jason Gunthorpe
2017-12-01 16:29                     ` Dan Williams
2017-12-01 16:31                       ` Jason Gunthorpe
2017-12-04  9:31                       ` Michal Hocko
2017-12-04 17:01                         ` Dan Williams
2017-11-29 18:05 ` [PATCH v3 2/4] mm: fail get_vaddr_frames() for filesystem-dax mappings Dan Williams
2017-11-29 18:05 ` [PATCH v3 3/4] [media] v4l2: disable filesystem-dax mapping support Dan Williams
2017-11-29 18:05 ` [PATCH v3 4/4] IB/core: disable memory registration of fileystem-dax vmas Dan Williams
2017-11-29 18:36   ` Jason Gunthorpe

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=151197872943.26211.6551382719053304996.stgit@dwillia2-desk3.amr.corp.intel.com \
    --to=dan.j.williams@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=dledford@redhat.com \
    --cc=hal.rosenstock@gmail.com \
    --cc=hch@lst.de \
    --cc=inki.dae@samsung.com \
    --cc=jack@suse.cz \
    --cc=jgunthorpe@obsidianresearch.com \
    --cc=jmoyer@redhat.com \
    --cc=jy0922.shim@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-nvdimm@lists.01.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=mgorman@suse.de \
    --cc=ross.zwisler@linux.intel.com \
    --cc=sean.hefty@intel.com \
    --cc=stable@vger.kernel.org \
    --cc=sw0312.kim@samsung.com \
    --cc=vbabka@suse.cz \
    /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).