On Tue, Oct 10, 2017 at 05:19:37PM +0200, Jan Kara wrote: > Currently we remove pages from the radix tree one by one. To speed up > page cache truncation, lock several pages at once and free them in one > go. This allows us to batch radix tree operations in a more efficient > way and also save round-trips on mapping->tree_lock. As a result we gain > about 20% speed improvement in page cache truncation. > > Data from a simple benchmark timing 10000 truncates of 1024 pages (on > ext4 on ramdisk but the filesystem is barely visible in the profiles). > The range shows 1% and 95% percentiles of the measured times: > > 4.14-rc2 4.14-rc2 + batched truncation > 248-256 209-219 > 249-258 209-217 > 248-255 211-239 > 248-255 209-217 > 247-256 210-218 > > Signed-off-by: Jan Kara <jack@xxxxxxx> Acked-by: Mel Gorman <mgorman@xxxxxxx> -- Mel Gorman SUSE Labs