linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] DAX common 4k zero page
@ 2017-06-14 17:22 Ross Zwisler
  2017-06-14 17:22 ` [PATCH v2 1/3] mm: add vm_insert_mixed_mkwrite() Ross Zwisler
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Ross Zwisler @ 2017-06-14 17:22 UTC (permalink / raw)
  To: Andrew Morton, linux-kernel
  Cc: Ross Zwisler, Darrick J. Wong, Theodore Ts'o, Alexander Viro,
	Andreas Dilger, Christoph Hellwig, Dan Williams, Dave Hansen,
	Ingo Molnar, Jan Kara, Jonathan Corbet, Matthew Wilcox,
	Steven Rostedt, linux-doc, linux-ext4, linux-fsdevel, linux-mm,
	linux-nvdimm, linux-xfs

When servicing mmap() reads from file holes the current DAX code allocates
a page cache page of all zeroes and places the struct page pointer in the
mapping->page_tree radix tree.  This has two major drawbacks:

1) It consumes memory unnecessarily.  For every 4k page that is read via a
DAX mmap() over a hole, we allocate a new page cache page.  This means that
if you read 1GiB worth of pages, you end up using 1GiB of zeroed memory.

2) The fact that we had to check for both DAX exceptional entries and for
page cache pages in the radix tree made the DAX code more complex.

This series solves these issues by following the lead of the DAX PMD code
and using a common 4k zero page instead.  This reduces memory usage for
some workloads, and it also simplifies the code in fs/dax.c, removing about
100 lines of code.

My hope is to have this reviewed and merged in time for v4.13 via the MM
tree, so if you could spare some review cycles I'd be grateful.

---
Changes since v1:
 - Leave vm_insert_mixed() instact with previous functionality and add
   vm_insert_mixed_mkwrite() as a peer so it is more readable/greppable.
   (Dan)

Ross Zwisler (3):
  mm: add vm_insert_mixed_mkwrite()
  dax: relocate dax_load_hole()
  dax: use common 4k zero page for dax mmap reads

 Documentation/filesystems/dax.txt |   5 +-
 fs/dax.c                          | 265 ++++++++++++--------------------------
 fs/ext2/file.c                    |  25 +---
 fs/ext4/file.c                    |  32 +----
 fs/xfs/xfs_file.c                 |   2 +-
 include/linux/dax.h               |  13 +-
 include/linux/mm.h                |   2 +
 include/trace/events/fs_dax.h     |   2 -
 mm/memory.c                       |  49 ++++++-
 9 files changed, 141 insertions(+), 254 deletions(-)

-- 
2.9.4

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

end of thread, other threads:[~2017-06-23 15:25 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-14 17:22 [PATCH v2 0/3] DAX common 4k zero page Ross Zwisler
2017-06-14 17:22 ` [PATCH v2 1/3] mm: add vm_insert_mixed_mkwrite() Ross Zwisler
2017-06-15 14:42   ` Jan Kara
2017-06-16 19:44     ` Ross Zwisler
2017-06-17  4:09     ` Ross Zwisler
2017-06-23 15:25       ` Jan Kara
2017-06-14 17:22 ` [PATCH v2 2/3] dax: relocate dax_load_hole() Ross Zwisler
2017-06-14 17:22 ` [PATCH v2 3/3] dax: use common 4k zero page for dax mmap reads Ross Zwisler
2017-06-15 14:58   ` Jan Kara
2017-06-16 19:45     ` Ross Zwisler

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