diff mbox series

[09/23] dax: Use dax_store_noinit() in grab_mapping_entry()

Message ID 20200422150256.23473-10-jack@suse.cz (mailing list archive)
State New, archived
Headers show
Series mm: Speedup page cache truncation | expand

Commit Message

Jan Kara April 22, 2020, 3:02 p.m. UTC
Although we store NULL here, there aren't any marks set on the entry
so use xas_store_noinit() to save some time when trying to reinitialize
marks. Furthermore we actually overwrite the entry shortly afterwards
with new PTE entry anyway.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 fs/dax.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/fs/dax.c b/fs/dax.c
index f8358928549c..03c6ca693f3c 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -523,7 +523,11 @@  static void *grab_mapping_entry(struct xa_state *xas,
 		}
 
 		dax_disassociate_entry(entry, mapping, false);
-		xas_store(xas, NULL);	/* undo the PMD join */
+		/*
+		 * Remove PMD entry. There should be no marks set for the entry
+ 		 * so don't bother reinitializing them with xas_erase().
+		 */
+		xas_store_noinit(xas, NULL);
 		dax_wake_entry(xas, entry, true);
 		mapping->nrexceptional--;
 		entry = NULL;