Skip to content

Speed up page cache truncation

Jan Kara linux-fsdevel linux-mm 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest7 patches 0 repliesNew
  2. v17 patches 13 repliesApplied 7/7

Changes in v2 from the cover letter

* Added acks and reviewed-by tags

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7mm: Speedup cancel_dirty_page() for clean pagesinclude/linux/mm.h mm/page-writeback.c+9 -30 replies
2/7mm: Refactor truncate_complete_page()mm/truncate.c+16 -140 replies
3/7mm: Factor out page cache page freeing into a separate functionmm/filemap.c+18 -130 replies
4/7mm: Move accounting updates before page_cache_tree_delete()mm/filemap.c+25 -240 replies
5/7mm: Move clearing of page->mapping to page_cache_tree_delete()mm/filemap.c+3 -30 replies
6/7mm: Factor out checks and accounting from __delete_from_page_cache()mm/filemap.c+41 -310 replies
7/7mm: Batch radix tree operations when truncating pagesinclude/linux/pagemap.h mm/filemap.c mm/truncate.c+104 -20 replies

Reviews trailers per patch

All 7 patches have a Reviewed-by or Acked-by.

PatchMel GormanAndi Kleen
1/7A-b R-b
2/7A-b R-b
3/7A-b R-b
4/7A-b R-b
5/7A-b R-b
6/7A-b R-b
7/7A-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH 0/7 v2] Speed up page cache truncation

Hello,

when rebasing our enterprise distro to a newer kernel (from 4.4 to 4.12) we have noticed a regression in bonnie++ benchmark when deleting files. Eventually we have tracked this down to a fact that page cache truncation got slower by about 10%. There were both gains and losses in the above interval of kernels but we have been able to identify that commit 83929372f629 "filemap:
prepare find and delete operations for huge pages" caused about 10% regression on its own.

After some investigation it didn't seem easily possible to fix the regression while maintaining the THP in page cache functionality so we've decided to optimize the page cache truncation path instead to make up for the change. This series is a result of that effort.

Patch 1 is an easy speedup of cancel_dirty_page(). Patches 2-6 refactor page cache truncation code so that it is easier to batch radix tree operations. Patch 7 implements batching of deletes from the radix tree which more than makes up for the original regression.

Andrew, can you please consider merging these patches? Thanks!

Changes since v1:
* Added acks and reviewed-by tags

Honza

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>