]> git.baikalelectronics.ru Git - kernel.git/commit
dax: Avoid page invalidation races and unnecessary radix tree traversals
authorJan Kara <jack@suse.cz>
Wed, 10 Aug 2016 15:10:28 +0000 (17:10 +0200)
committerDan Williams <dan.j.williams@intel.com>
Tue, 27 Dec 2016 04:29:24 +0000 (20:29 -0800)
commit3c022bf9110c423e6e0cf44412c18cbda42ecc54
tree52e8c6f6bea775cb623cfca46012b91657b7dc47
parent6c8310064fa28c552eb202d9ab72be34cbcfdd18
dax: Avoid page invalidation races and unnecessary radix tree traversals

Currently dax_iomap_rw() takes care of invalidating page tables and
evicting hole pages from the radix tree when write(2) to the file
happens. This invalidation is only necessary when there is some block
allocation resulting from write(2). Furthermore in current place the
invalidation is racy wrt page fault instantiating a hole page just after
we have invalidated it.

So perform the page invalidation inside dax_iomap_actor() where we can
do it only when really necessary and after blocks have been allocated so
nobody will be instantiating new hole pages anymore.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
fs/dax.c