aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mm/cma.c
diff options
context:
space:
mode:
authorShakeel Butt <shakeel.butt@linux.dev>2024-09-25 15:47:16 -0700
committerAndrew Morton <akpm@linux-foundation.org>2024-11-05 16:56:30 -0800
commitd3db2c0425915f6b0f273770feee2e2f97dba6a3 (patch)
tree618a9e1a411844df72547b8d610b1b856e45950e /mm/cma.c
parentmm: optimize truncation of shadow entries (diff)
downloadwireguard-linux-d3db2c0425915f6b0f273770feee2e2f97dba6a3.tar.xz
wireguard-linux-d3db2c0425915f6b0f273770feee2e2f97dba6a3.zip
mm: optimize invalidation of shadow entries
The kernel invalidates the page cache in batches of PAGEVEC_SIZE. For each batch, it traverses the page cache tree and collects the entries (folio and shadow entries) in the struct folio_batch. For the shadow entries present in the folio_batch, it has to traverse the page cache tree for each individual entry to remove them. This patch optimize this by removing them in a single tree traversal. To evaluate the changes, we created 200GiB file on a fuse fs and in a memcg. We created the shadow entries by triggering reclaim through memory.reclaim in that specific memcg and measure the simple fadvise(DONTNEED) operation. # time xfs_io -c 'fadvise -d 0 ${file_size}' file time (sec) Without 5.12 +- 0.061 With-patch 4.19 +- 0.086 (18.16% decrease) Link: https://lkml.kernel.org/r/20240925224716.2904498-3-shakeel.butt@linux.dev Signed-off-by: Shakeel Butt <shakeel.butt@linux.dev> Cc: Chris Mason <clm@fb.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Matthew Wilcox <willy@infradead.org> Cc: Omar Sandoval <osandov@osandov.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/cma.c')
0 files changed, 0 insertions, 0 deletions