linux/mm
Yosry Ahmed b8cf32dc6e mm: zswap: multiple zpools support
Support using multiple zpools of the same type in zswap, for concurrency
purposes.  A fixed number of 32 zpools is suggested by this commit, which
was determined empirically.  It can be later changed or made into a config
option if needed.

On a setup with zswap and zsmalloc, comparing a single zpool to 32 zpools
shows improvements in the zsmalloc lock contention, especially on the swap
out path.

The following shows the perf analysis of the swapout path when 10
workloads are simultaneously reclaiming and refaulting tmpfs pages.  There
are some improvements on the swap in path as well, but less significant.

1 zpool:

 |--28.99%--zswap_frontswap_store
       |
       <snip>
       |
       |--8.98%--zpool_map_handle
       |     |
       |      --8.98%--zs_zpool_map
       |           |
       |            --8.95%--zs_map_object
       |                 |
       |                  --8.38%--_raw_spin_lock
       |                       |
       |                        --7.39%--queued_spin_lock_slowpath
       |
       |--8.82%--zpool_malloc
       |     |
       |      --8.82%--zs_zpool_malloc
       |           |
       |            --8.80%--zs_malloc
       |                 |
       |                 |--7.21%--_raw_spin_lock
       |                 |     |
       |                 |      --6.81%--queued_spin_lock_slowpath
       <snip>

32 zpools:

 |--16.73%--zswap_frontswap_store
       |
       <snip>
       |
       |--1.81%--zpool_malloc
       |     |
       |      --1.81%--zs_zpool_malloc
       |           |
       |            --1.79%--zs_malloc
       |                 |
       |                  --0.73%--obj_malloc
       |
       |--1.06%--zswap_update_total_size
       |
       |--0.59%--zpool_map_handle
       |     |
       |      --0.59%--zs_zpool_map
       |           |
       |            --0.57%--zs_map_object
       |                 |
       |                  --0.51%--_raw_spin_lock
       <snip>

Link: https://lkml.kernel.org/r/20230620194644.3142384-1-yosryahmed@google.com
Signed-off-by: Yosry Ahmed <yosryahmed@google.com>
Suggested-by: Yu Zhao <yuzhao@google.com>
Acked-by: Chris Li (Google) <chrisl@kernel.org>
Reviewed-by: Nhat Pham <nphamcs@gmail.com>
Tested-by: Nhat Pham <nphamcs@gmail.com>
Cc: Dan Streetman <ddstreet@ieee.org>
Cc: Domenico Cerasuolo <cerasuolodomenico@gmail.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Seth Jennings <sjenning@redhat.com>
Cc: Vitaly Wool <vitaly.wool@konsulko.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2023-08-21 13:37:25 -07:00
..
damon
kasan
kfence mm: kfence: allocate kfence_metadata at runtime 2023-08-18 10:12:39 -07:00
kmsan
backing-dev.c
balloon_compaction.c
bootmem_info.c
cma.c mm: cma: print cma name as well in cma_alloc debug 2023-08-18 10:12:12 -07:00
cma.h
cma_debug.c
cma_sysfs.c
compaction.c mm/compaction: avoid unneeded pageblock_end_pfn when no_set_skip_hint is set 2023-08-18 10:12:44 -07:00
debug.c
debug_page_alloc.c
debug_page_ref.c
debug_vm_pgtable.c mm: change pudp_huge_get_and_clear_full take vm_area_struct as arg 2023-08-18 10:12:53 -07:00
dmapool.c
dmapool_test.c
early_ioremap.c
fadvise.c
fail_page_alloc.c
failslab.c
filemap.c mm: merge folio_has_private()/filemap_release_folio() call pairs 2023-08-18 10:12:12 -07:00
folio-compat.c
frontswap.c
gup.c mm/gup: retire follow_hugetlb_page() 2023-08-18 10:12:04 -07:00
gup_test.c
gup_test.h
highmem.c
hmm.c
huge_memory.c mm: change pudp_huge_get_and_clear_full take vm_area_struct as arg 2023-08-18 10:12:53 -07:00
hugetlb.c mm: move FAULT_FLAG_VMA_LOCK check from handle_mm_fault() 2023-08-18 10:12:51 -07:00
hugetlb_cgroup.c
hugetlb_vmemmap.c mm: hugetlb_vmemmap: fix a race between vmemmap pmd split 2023-08-18 10:12:14 -07:00
hugetlb_vmemmap.h
hwpoison-inject.c
init-mm.c
internal.h mm: set up vma iterator for vma_iter_prealloc() calls 2023-08-18 10:12:49 -07:00
interval_tree.c
io-mapping.c
ioremap.c mm: ioremap: remove unneeded ioremap_allowed and iounmap_allowed 2023-08-18 10:12:36 -07:00
Kconfig mm/vmemmap optimization: split hugetlb and devdax vmemmap optimization 2023-08-18 10:12:54 -07:00
Kconfig.debug
khugepaged.c mm/khugepaged: delete khugepaged_collapse_pte_mapped_thps() 2023-08-18 10:12:25 -07:00
kmemleak.c
ksm.c ksm: consider KSM-placed zeropages when calculating KSM profit 2023-08-18 10:12:10 -07:00
list_lru.c
maccess.c
madvise.c mm: make PTE_MARKER_SWAPIN_ERROR more general 2023-08-18 10:12:16 -07:00
Makefile
mapping_dirty_helpers.c
memblock.c
memcontrol.c mm/memcg: minor cleanup for mc_handle_present_pte() 2023-08-18 10:12:37 -07:00
memfd.c mm/memfd: sysctl: fix MEMFD_NOEXEC_SCOPE_NOEXEC_ENFORCED 2023-08-18 10:12:11 -07:00
memory-failure.c mm/hwpoison: check if a raw page in a hugetlb folio is raw HWPOISON 2023-08-18 10:12:26 -07:00
memory-tiers.c memory tier: use helper macro __ATTR_RW() 2023-08-18 10:12:38 -07:00
memory.c mm: handle faults that merely update the accessed bit under the VMA lock 2023-08-18 10:12:53 -07:00
memory_hotplug.c mm/memory_hotplug: document the signal_pending() check in offline_pages() 2023-08-18 10:12:19 -07:00
mempolicy.c
mempool.c
memremap.c
memtest.c
migrate.c migrate: use folio_set_bh() instead of set_bh_page() 2023-08-18 10:12:30 -07:00
migrate_device.c mmu_notifiers: don't invalidate secondary TLBs as part of mmu_notifier_invalidate_range_end() 2023-08-18 10:12:41 -07:00
mincore.c
mlock.c
mm_init.c mm/vmemmap: improve vmemmap_can_optimize and allow architectures to override 2023-08-18 10:12:53 -07:00
mm_slot.h
mmap.c mm/mmap: change vma iteration order in do_vmi_align_munmap() 2023-08-18 10:12:50 -07:00
mmap_lock.c
mmu_gather.c
mmu_notifier.c mmu_notifiers: rename invalidate_range notifier 2023-08-18 10:12:41 -07:00
mmzone.c
mprotect.c mm/mprotect: fix obsolete function name in change_pte_range() 2023-08-18 10:12:43 -07:00
mremap.c mm/huge pud: use transparent huge pud helpers only with CONFIG_TRANSPARENT_HUGEPAGE 2023-08-18 10:12:54 -07:00
msync.c
nommu.c mm: set up vma iterator for vma_iter_prealloc() calls 2023-08-18 10:12:49 -07:00
oom_kill.c
page-writeback.c
page_alloc.c mm: page_alloc: avoid false page outside zone error info 2023-08-18 10:12:10 -07:00
page_counter.c
page_ext.c mm/page_ext: move functions around for minor cleanups to page_ext 2023-08-18 10:12:31 -07:00
page_idle.c
page_io.c mm/page_io: convert bio_associate_blkg_from_page() to take in a folio 2023-08-18 10:12:46 -07:00
page_isolation.c mm/hugetlb: get rid of page_hstate() 2023-08-18 10:12:39 -07:00
page_owner.c
page_poison.c
page_reporting.c
page_reporting.h
page_table_check.c mm/page_table_check: remove unused parameter in [__]page_table_check_pud_set 2023-08-18 10:12:29 -07:00
page_vma_mapped.c mm: correct stale comment of function check_pte 2023-08-18 10:12:13 -07:00
pagewalk.c
percpu-internal.h
percpu-km.c
percpu-stats.c
percpu-vm.c
percpu.c
pgalloc-track.h
pgtable-generic.c mm/pgtable: notes on pte_offset_map[_lock]() 2023-08-18 10:12:25 -07:00
process_vm_access.c
ptdump.c
readahead.c
rmap.c mmu_notifiers: don't invalidate secondary TLBs as part of mmu_notifier_invalidate_range_end() 2023-08-18 10:12:41 -07:00
rodata_test.c
secretmem.c
shmem.c mm: make PTE_MARKER_SWAPIN_ERROR more general 2023-08-18 10:12:16 -07:00
show_mem.c mm: make show_free_areas() static 2023-08-18 10:12:02 -07:00
shrinker_debug.c
shuffle.c
shuffle.h
slab.c
slab.h
slab_common.c
slub.c
sparse-vmemmap.c mm/vmemmap: allow architectures to override how vmemmap optimization works 2023-08-18 10:12:53 -07:00
sparse.c mm/sparse: remove redundant judgments from macro for_each_present_section_nr 2023-08-18 10:12:14 -07:00
swap.c
swap.h
swap_cgroup.c
swap_slots.c
swap_state.c
swapfile.c mm: make PTE_MARKER_SWAPIN_ERROR more general 2023-08-18 10:12:16 -07:00
truncate.c mm: merge folio_has_private()/filemap_release_folio() call pairs 2023-08-18 10:12:12 -07:00
usercopy.c
userfaultfd.c mm: userfaultfd: support UFFDIO_POISON for hugetlbfs 2023-08-18 10:12:17 -07:00
util.c mm: remove page_rmapping() 2023-08-18 10:12:01 -07:00
vmalloc.c
vmpressure.c
vmscan.c mm: merge folio_has_private()/filemap_release_folio() call pairs 2023-08-18 10:12:12 -07:00
vmstat.c
workingset.c
z3fold.c
zbud.c
zpool.c
zsmalloc.c zsmalloc: remove obj_tagged() 2023-08-18 10:12:18 -07:00
zswap.c mm: zswap: multiple zpools support 2023-08-21 13:37:25 -07:00