Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934040AbbLWTjc (ORCPT ); Wed, 23 Dec 2015 14:39:32 -0500 Received: from mga03.intel.com ([134.134.136.65]:38241 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934011AbbLWTj2 (ORCPT ); Wed, 23 Dec 2015 14:39:28 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,470,1444719600"; d="scan'208";a="879949922" From: Ross Zwisler To: linux-kernel@vger.kernel.org Cc: Ross Zwisler , "H. Peter Anvin" , "J. Bruce Fields" , "Theodore Ts'o" , Alexander Viro , Andreas Dilger , Dave Chinner , Ingo Molnar , Jan Kara , Jeff Layton , Matthew Wilcox , Thomas Gleixner , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@ml01.01.org, x86@kernel.org, xfs@oss.sgi.com, Andrew Morton , Dan Williams , Matthew Wilcox , Dave Hansen Subject: [PATCH v6 0/7] DAX fsync/msync support Date: Wed, 23 Dec 2015 12:39:13 -0700 Message-Id: <1450899560-26708-1-git-send-email-ross.zwisler@linux.intel.com> X-Mailer: git-send-email 2.6.3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3047 Lines: 74 Changes since v5 [1]: 1) Merged with Dan's changes to fs/dax.c that were staged in -mm and -next. 2) Store sectors in the address_space radix tree for DAX entries instead of addresses. This allows us to get the addresses from the block driver via dax_map_atomic() during fsync/msync so that we can protect against races with block device removal. (Dan) 3) Reordered things a bit in dax_writeback_one() so we clear the PAGECACHE_TAG_TOWRITE tag even if the radix tree entry is corrupt. This prevents us from getting into an infinite loop where we don't proceed far enough in dax_writeback_one() to clear that flag, but dax_writeback_mapping_range() will keep finding that entry via find_get_entries_tag(). 4) Changed the ordering of the radix tree insertion so that it happens before the page insertion into the page tables. This ensures that we don't end up in a case where the page table insertion succeeds and the radix tree insertion fails which could give us a writeable PTE that has no corresponding radix tree entry. 5) Got rid of the 'nrdax' variable in struct address_space and renamed 'nrshadows' to 'nrexceptional' so that it can be used for both DAX and shadow exceptional entries. We explicitly prevent shadow entries from being added to radix trees for DAX mappings, so the single counter can safely be reused for both purposes. (Jan) 6) Updated all my WARN_ON() calls so I use the return value to know whether I've hit an erorr. (Andrew) This series applies cleanly and was tested against next-20151223. A working tree can be found here: https://git.kernel.org/cgit/linux/kernel/git/zwisler/linux.git/log/?h=fsync_v6 [1]: https://lists.01.org/pipermail/linux-nvdimm/2015-December/003588.html Ross Zwisler (7): pmem: add wb_cache_pmem() to the PMEM API dax: support dirty DAX entries in radix tree mm: add find_get_entries_tag() dax: add support for fsync/msync ext2: call dax_pfn_mkwrite() for DAX fsync/msync ext4: call dax_pfn_mkwrite() for DAX fsync/msync xfs: call dax_pfn_mkwrite() for DAX fsync/msync arch/x86/include/asm/pmem.h | 11 +-- fs/block_dev.c | 2 +- fs/dax.c | 196 ++++++++++++++++++++++++++++++++++++++++++-- fs/ext2/file.c | 4 +- fs/ext4/file.c | 4 +- fs/inode.c | 2 +- fs/xfs/xfs_file.c | 7 +- include/linux/dax.h | 7 ++ include/linux/fs.h | 3 +- include/linux/pagemap.h | 3 + include/linux/pmem.h | 22 ++++- include/linux/radix-tree.h | 9 ++ mm/filemap.c | 91 ++++++++++++++++++-- mm/truncate.c | 69 +++++++++------- mm/vmscan.c | 9 +- mm/workingset.c | 4 +- 16 files changed, 384 insertions(+), 59 deletions(-) -- 2.6.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/