Skip to contentSkip to conversation

dax: Fix inefficiency in dax_writeback_mapping_range()

PATCH Applied Jan Kara 2 participants 2 messages Jun 19, 2017

Subsystems (5)
lore
Share & tools
lore

Jan Kara

author reviewer
#0 lore raw

PATCH 1/1 dax: Fix inefficiency in dax_writeback_mapping_range()

dax_writeback_mapping_range() fails to update iteration index when searching radix tree for entries needing cache flushing. Thus each pagevec worth of entries is searched starting from the start which is inefficient and prone to livelocks. Update index properly.

Fixes 9973c98ecfda3a1dfcab981665b5f1e39bcde64a
---
 fs/dax.c | 1 +
 1 file changed, 1 insertion(+)
fs/dax.c +1 -0
index 2a6889b3585f..9187f3b07f3e 100644
@@ -859,6 +859,7 @@ int dax_writeback_mapping_range(struct address_space *mapping,
 			if (ret < 0)
 				goto out;
 		}
+		start_index = indices[pvec.nr - 1] + 1;
 	}
 out:
 	put_dax(dax_dev);
Signature · 6 lines
2.12.3

_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Jan Kara

dax_writeback_mapping_range() fails to update iteration index when searching radix tree for entries needing cache flushing. Thus each pagevec worth of entries is searched starting from the start which is inefficient and prone to livelocks. Update index properly.

Fixes 9973c98ecfda3a1dfcab981665b5f1e39bcde64a

Yep, this seems good, thanks.

_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm