linux-stable/include
Matthew Wilcox (Oracle) 99fbb6bfc1 mm: make folios_put() the basis of release_pages()
Patch series "Rearrange batched folio freeing", v3.

Other than the obvious "remove calls to compound_head" changes, the
fundamental belief here is that iterating a linked list is much slower
than iterating an array (5-15x slower in my testing).  There's also an
associated belief that since we iterate the batch of folios three times,
we do better when the array is small (ie 15 entries) than we do with a
batch that is hundreds of entries long, which only gives us the
opportunity for the first pages to fall out of cache by the time we get to
the end.

It is possible we should increase the size of folio_batch.  Hopefully the
bots let us know if this introduces any performance regressions.


This patch (of 3):

By making release_pages() call folios_put(), we can get rid of the calls
to compound_head() for the callers that already know they have folios.  We
can also get rid of the lock_batch tracking as we know the size of the
batch is limited by folio_batch.  This does reduce the maximum number of
pages for which the lruvec lock is held, from SWAP_CLUSTER_MAX (32) to
PAGEVEC_SIZE (15).  I do not expect this to make a significant difference,
but if it does, we can increase PAGEVEC_SIZE to 31.

Link: https://lkml.kernel.org/r/20240227174254.710559-1-willy@infradead.org
Link: https://lkml.kernel.org/r/20240227174254.710559-2-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: David Hildenbrand <david@redhat.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2024-03-04 17:01:22 -08:00
..
acpi IOMMU Updates for Linux v6.8 2024-01-18 15:16:57 -08:00
asm-generic mm/mmu_gather: add __tlb_remove_folio_pages() 2024-02-22 15:27:17 -08:00
clocksource
crypto
drm drm-next for 6.8: 2024-01-12 11:32:19 -08:00
dt-bindings dmaengine fixes for v6.8-rc1 2024-01-20 15:03:25 -08:00
keys
kunit Networking changes for 6.8. 2024-01-11 10:07:29 -08:00
kvm
linux mm: make folios_put() the basis of release_pages() 2024-03-04 17:01:22 -08:00
math-emu
media
memory
misc
net tls: fix race between async notify and socket close 2024-02-10 21:38:19 +00:00
pcmcia
ras
rdma
rv
scsi
soc - New Device Support 2024-01-17 15:21:21 -08:00
sound ASoC: tas2781: add module parameter to tascodec_init() 2024-02-05 14:31:37 +00:00
target
trace mm: update mark_victim tracepoints fields 2024-03-04 17:01:16 -08:00
uapi mm/mempolicy: introduce MPOL_WEIGHTED_INTERLEAVE for weighted interleaving 2024-02-22 10:24:46 -08:00
ufs
vdso
video video/sticore: Remove info field from STI struct 2024-01-12 12:38:37 +01:00
xen