linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [LSF/MM/BPF TOPIC] Do not pin pages for various direct-io scheme
@ 2020-01-22  2:31 jglisse
  2020-01-22  3:54 ` Jens Axboe
  2020-01-22  4:19 ` Dan Williams
  0 siblings, 2 replies; 16+ messages in thread
From: jglisse @ 2020-01-22  2:31 UTC (permalink / raw)
  To: lsf-pc
  Cc: Jérôme Glisse, linux-fsdevel, linux-mm, Jens Axboe,
	Benjamin LaHaise

From: Jérôme Glisse <jglisse@redhat.com>

Direct I/O does pin memory through GUP (get user page) this does
block several mm activities like:
    - compaction
    - numa
    - migration
    ...

It is also troublesome if the pinned pages are actualy file back
pages that migth go under writeback. In which case the page can
not be write protected from direct-io point of view (see various
discussion about recent work on GUP [1]). This does happens for
instance if the virtual memory address use as buffer for read
operation is the outcome of an mmap of a regular file.


With direct-io or aio (asynchronous io) pages are pinned until
syscall completion (which depends on many factors: io size,
block device speed, ...). For io-uring pages can be pinned an
indifinite amount of time.


So i would like to convert direct io code (direct-io, aio and
io-uring) to obey mmu notifier and thus allow memory management
and writeback to work and behave like any other process memory.

For direct-io and aio this mostly gives a way to wait on syscall
completion. For io-uring this means that buffer might need to be
re-validated (ie looking up pages again to get the new set of
pages for the buffer). Impact for io-uring is the delay needed
to lookup new pages or wait on writeback (if necessary). This
would only happens _if_ an invalidation event happens, which it-
self should only happen under memory preissure or for NUMA
activities.

They are ways to minimize the impact (for instance by using the
mmu notifier type to ignore some invalidation cases).


So i would like to discuss all this during LSF, it is mostly a
filesystem discussion with strong tie to mm.


[1] GUP https://lkml.org/lkml/2019/3/8/805 and all subsequent
    discussion.

To: lsf-pc@lists.linux-foundation.org
Cc: linux-fsdevel@vger.kernel.org
Cc: linux-mm@kvack.org
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Benjamin LaHaise <bcrl@kvack.org>


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

end of thread, other threads:[~2020-01-27 19:01 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-22  2:31 [LSF/MM/BPF TOPIC] Do not pin pages for various direct-io scheme jglisse
2020-01-22  3:54 ` Jens Axboe
2020-01-22  4:57   ` Jerome Glisse
2020-01-22 11:59     ` Michal Hocko
2020-01-22 15:12       ` Jens Axboe
2020-01-22 16:54         ` Jerome Glisse
2020-01-22 17:04           ` Jens Axboe
2020-01-22 17:28             ` Jerome Glisse
2020-01-22 17:38               ` Jens Axboe
2020-01-22 17:40                 ` Jerome Glisse
2020-01-22 17:49                   ` Jens Axboe
2020-01-27 19:01   ` Jason Gunthorpe
2020-01-22  4:19 ` Dan Williams
2020-01-22  5:00   ` Jerome Glisse
2020-01-22 15:56     ` [Lsf-pc] " Dan Williams
2020-01-22 17:02       ` Jerome Glisse

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