[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200422150256.23473-15-jack@suse.cz>
Date: Wed, 22 Apr 2020 17:02:47 +0200
From: Jan Kara <jack@...e.cz>
To: Matthew Wilcox <willy@...radead.org>
Cc: <linux-fsdevel@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>, Jan Kara <jack@...e.cz>
Subject: [PATCH 14/23] workingset: Use xas_store_noinit() to clear shadow entry
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@...e.cz>
---
mm/truncate.c | 2 +-
mm/workingset.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/mm/truncate.c b/mm/truncate.c
index dd9ebc1da356..baef636564cc 100644
--- a/mm/truncate.c
+++ b/mm/truncate.c
@@ -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--;
}
diff --git a/mm/workingset.c b/mm/workingset.c
index 474186b76ced..6a492140057f 100644
--- a/mm/workingset.c
+++ b/mm/workingset.c
@@ -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:
--
2.16.4
Powered by blists - more mailing lists