@@ -39,7 +39,7 @@ static inline void __clear_shadow_entry(struct address_space *mapping,
xas_set_update(&xas, workingset_update_node);
if (xas_load(&xas) != entry)
return;
- xas_store(&xas, NULL);
+ xas_store_noinit(&xas, NULL);
mapping->nrexceptional--;
}
@@ -537,7 +537,7 @@ static enum lru_status shadow_lru_isolate(struct list_head *item,
* We could store a shadow entry here which was the minimum of the
* shadow entries we were tracking ...
*/
- xas_store(&xas, NULL);
+ xas_store_noinit(&xas, NULL);
__inc_lruvec_slab_state(node, WORKINGSET_NODERECLAIM);
out_invalid:
Shadow entries have no marks. Use xas_store_noinit() to clear the entry so avoid unneeded initialization of the xarray marks. This provides a nice boost to truncate numbers. Sample benchmark showing time to truncate 128 files 1GB each on machine with 64GB of RAM (so about half of entries are shadow entries): AVG STDDEV Vanilla 4.825s 0.036 Patched 4.516s 0.014 So we can see about 6% reduction in overall truncate time. Signed-off-by: Jan Kara <jack@suse.cz> --- mm/truncate.c | 2 +- mm/workingset.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)