linux/mm
Luis Chamberlain 9a976f0c84 shmem: skip page split if we're not reclaiming
In theory when info->flags & VM_LOCKED we should not be getting
shem_writepage() called so we should be verifying this with a
WARN_ON_ONCE().  Since we should not be swapping then best to ensure we
also don't do the folio split earlier too.  So just move the check early
to avoid folio splits in case its a dubious call.

We also have a similar early bail when !total_swap_pages so just move that
earlier to avoid the possible folio split in the same situation.

Link: https://lkml.kernel.org/r/20230309230545.2930737-5-mcgrof@kernel.org
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Acked-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Christian Brauner <brauner@kernel.org>
Reviewed-by: Yosry Ahmed <yosryahmed@google.com>
Tested-by: Xin Hao <xhao@linux.alibaba.com>
Reviewed-by: Davidlohr Bueso <dave@stgolabs.net>
Cc: Adam Manzanares <a.manzanares@samsung.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: Hugh Dickins <hughd@google.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Pankaj Raghav <p.raghav@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2023-03-28 16:20:15 -07:00
..
damon mm/damon/paddr: fix folio_nr_pages() after folio_put() in damon_pa_mark_accessed_or_deactivate() 2023-03-07 17:04:55 -08:00
kasan kasan: test: fix test for new meminstrinsic instrumentation 2023-03-02 21:54:22 -08:00
kfence mm: kfence: fix handling discontiguous page 2023-03-28 15:24:32 -07:00
kmsan kmsan: add test_stackdepot_roundtrip 2023-03-28 16:20:14 -07:00
backing-dev.c
balloon_compaction.c
bootmem_info.c
cma.c
cma.h
cma_debug.c
cma_sysfs.c mm: cma: make kobj_type structure constant 2023-03-28 16:20:06 -07:00
compaction.c
debug.c mm/debug: use %pGt to display page_type in dump_page() 2023-03-28 16:20:09 -07:00
debug_page_ref.c
debug_vm_pgtable.c mm/debug_vm_pgtable: replace pte_mkhuge() with arch_make_huge_pte() 2023-03-28 16:20:11 -07:00
dmapool.c
early_ioremap.c
fadvise.c
failslab.c
filemap.c
folio-compat.c
frontswap.c
gup.c mm/gup.c: fix typo in comments 2023-03-28 16:20:14 -07:00
gup_test.c
gup_test.h
highmem.c
hmm.c
huge_memory.c mm: huge_memory: convert __do_huge_pmd_anonymous_page() to use a folio 2023-03-28 16:20:09 -07:00
hugetlb.c
hugetlb_cgroup.c
hugetlb_vmemmap.c mm: hugetlb_vmemmap: simplify hugetlb_vmemmap_init() a bit 2023-03-28 16:20:06 -07:00
hugetlb_vmemmap.h
hwpoison-inject.c
init-mm.c
internal.h mm, printk: introduce new format %pGt for page_type 2023-03-28 16:20:09 -07:00
interval_tree.c
io-mapping.c
ioremap.c
Kconfig
Kconfig.debug
khugepaged.c mm/khugepaged: cleanup memcg uncharge for failure path 2023-03-28 16:20:11 -07:00
kmemleak.c
ksm.c mm: add tracepoints to ksm 2023-03-28 16:20:08 -07:00
list_lru.c
maccess.c
madvise.c
Makefile
mapping_dirty_helpers.c
memblock.c memblock: small optimizations 2023-02-27 09:34:53 -08:00
memcontrol.c mm, memcg: Prevent memory.soft_limit_in_bytes load/store tearing 2023-03-28 16:20:13 -07:00
memfd.c
memory-failure.c mm/hwpoison: convert TTU_IGNORE_HWPOISON to TTU_HWPOISON 2023-02-27 17:00:14 -08:00
memory-tiers.c
memory.c mm: add PTE pointer parameter to flush_tlb_fix_spurious_fault() 2023-03-28 16:20:12 -07:00
memory_hotplug.c
mempolicy.c
mempool.c
memremap.c
memtest.c
migrate.c mm/migrate: drop pte_mkhuge() in remove_migration_pte() 2023-03-28 16:20:11 -07:00
migrate_device.c
mincore.c mm: teach mincore_hugetlb about pte markers 2023-03-07 17:04:53 -08:00
mlock.c
mm_init.c
mm_slot.h
mmap.c mm: deduplicate error handling for map_deny_write_exec 2023-03-23 17:18:32 -07:00
mmap_lock.c
mmu_gather.c
mmu_notifier.c
mmzone.c
mprotect.c mm: fix error handling for map_deny_write_exec 2023-03-23 17:18:33 -07:00
mremap.c x86/mm/pat: clear VM_PAT if copy_p4d_range failed 2023-03-28 16:20:07 -07:00
msync.c
nommu.c
oom_kill.c
page-writeback.c mm,jfs: move write_one_page/folio_write_one to jfs 2023-03-28 16:20:14 -07:00
page_alloc.c mm, page_alloc: reduce page alloc/free sanity checks 2023-03-28 16:20:06 -07:00
page_counter.c
page_ext.c
page_idle.c
page_io.c
page_isolation.c
page_owner.c
page_poison.c
page_reporting.c
page_reporting.h
page_table_check.c
page_vma_mapped.c
pagewalk.c
percpu-internal.h
percpu-km.c
percpu-stats.c
percpu-vm.c
percpu.c
pgalloc-track.h
pgtable-generic.c mm: add PTE pointer parameter to flush_tlb_fix_spurious_fault() 2023-03-28 16:20:12 -07:00
process_vm_access.c
ptdump.c
readahead.c
rmap.c mm/rmap: use atomic_try_cmpxchg in set_tlb_ubc_flush_pending 2023-03-28 16:20:09 -07:00
rodata_test.c
secretmem.c
shmem.c shmem: skip page split if we're not reclaiming 2023-03-28 16:20:15 -07:00
shrinker_debug.c
shuffle.c
shuffle.h
slab.c slab fix for 6.3-rc4 2023-03-24 10:12:14 -07:00
slab.h
slab_common.c
slob.c
slub.c
sparse-vmemmap.c
sparse.c
swap.c
swap.h
swap_cgroup.c
swap_slots.c
swap_state.c
swapfile.c mm: swap: remove unneeded cgroup_throttle_swaprate() 2023-03-28 16:20:10 -07:00
truncate.c
usercopy.c
userfaultfd.c mm/userfaultfd: support WP on multiple VMAs 2023-03-28 16:20:07 -07:00
util.c
vmalloc.c mm, vmalloc: fix high order __GFP_NOFAIL allocations 2023-03-23 17:18:31 -07:00
vmpressure.c
vmscan.c mm: multi-gen LRU: improve design doc 2023-03-28 16:20:07 -07:00
vmstat.c
workingset.c
z3fold.c
zbud.c
zpool.c
zsmalloc.c zsmalloc: show per fullness group class stats 2023-03-28 16:20:12 -07:00
zswap.c mm/zswap: try to avoid worst-case scenario on same element pages 2023-03-28 16:20:07 -07:00