linux_dsm_epyc7002/mm
Joonsoo Kim 1d91df85f3 mm/page_alloc: handle a missing case for memalloc_nocma_{save/restore} APIs
memalloc_nocma_{save/restore} APIs can be used to skip page allocation
on CMA area, but, there is a missing case and the page on CMA area could
be allocated even if APIs are used.  This patch handles this case to fix
the potential issue.

For now, these APIs are used to prevent long-term pinning on the CMA
page.  When the long-term pinning is requested on the CMA page, it is
migrated to the non-CMA page before pinning.  This non-CMA page is
allocated by using memalloc_nocma_{save/restore} APIs.  If APIs doesn't
work as intended, the CMA page is allocated and it is pinned for a long
time.  This long-term pin for the CMA page causes cma_alloc() failure
and it could result in wrong behaviour on the device driver who uses the
cma_alloc().

Missing case is an allocation from the pcplist.  MIGRATE_MOVABLE pcplist
could have the pages on CMA area so we need to skip it if ALLOC_CMA
isn't specified.

Fixes: 8510e69c8e (mm/page_alloc: fix memalloc_nocma_{save/restore} APIs)
Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: "Aneesh Kumar K . V" <aneesh.kumar@linux.ibm.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Link: https://lkml.kernel.org/r/1601429472-12599-1-git-send-email-iamjoonsoo.kim@lge.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-10-03 11:28:12 -07:00
..
kasan
backing-dev.c
balloon_compaction.c
cleancache.c
cma_debug.c
cma.c
cma.h
compaction.c
debug_page_ref.c
debug_vm_pgtable.c
debug.c
dmapool.c
early_ioremap.c
fadvise.c
failslab.c
filemap.c io_uring-5.9-2020-10-02 2020-10-02 14:38:10 -07:00
frame_vector.c
frontswap.c
gup_benchmark.c
gup.c mm: do not rely on mm == current->mm in __get_user_pages_locked 2020-09-28 09:21:50 -07:00
highmem.c
hmm.c
huge_memory.c mm/thp: Split huge pmds/puds if they're pinned when fork() 2020-09-27 11:21:35 -07:00
hugetlb_cgroup.c
hugetlb.c
hwpoison-inject.c
init-mm.c
internal.h
interval_tree.c
ioremap.c
Kconfig
Kconfig.debug
khugepaged.c
kmemleak-test.c
kmemleak.c
ksm.c ksm: reinstate memcg charge on copied pages 2020-09-19 13:13:38 -07:00
list_lru.c
maccess.c
madvise.c mm: validate pmd after splitting 2020-09-26 10:48:08 -07:00
Makefile
mapping_dirty_helpers.c
memblock.c
memcontrol.c mm: memcontrol: fix missing suffix of workingset_restore 2020-09-26 10:33:57 -07:00
memfd.c
memory_hotplug.c mm: don't rely on system state to detect hot-plug operations 2020-09-26 10:33:57 -07:00
memory-failure.c
memory.c mm: Do early cow for pinned pages during fork() for ptes 2020-09-27 11:21:35 -07:00
mempolicy.c
mempool.c
memremap.c
memtest.c
migrate.c mm/migrate: correct thp migration stats 2020-09-26 10:33:57 -07:00
mincore.c
mlock.c mlock: fix unevictable_pgs event counts on THP 2020-09-19 13:13:38 -07:00
mm_init.c
mmap.c
mmu_gather.c
mmu_notifier.c
mmzone.c
mprotect.c
mremap.c
msync.c
nommu.c
oom_kill.c
page_alloc.c mm/page_alloc: handle a missing case for memalloc_nocma_{save/restore} APIs 2020-10-03 11:28:12 -07:00
page_counter.c
page_ext.c
page_idle.c
page_io.c
page_isolation.c mm/memory_hotplug: drain per-cpu pages again during memory offline 2020-09-19 13:13:39 -07:00
page_owner.c
page_poison.c
page_reporting.c
page_reporting.h
page_vma_mapped.c
page-writeback.c
pagewalk.c
percpu-internal.h
percpu-km.c
percpu-stats.c
percpu-vm.c
percpu.c percpu: fix first chunk size calculation for populated bitmap 2020-09-17 17:34:39 +00:00
pgalloc-track.h
pgtable-generic.c
process_vm_access.c
ptdump.c
readahead.c
rmap.c
rodata_test.c
shmem.c tmpfs: restore functionality of nr_inodes=0 2020-09-19 13:13:38 -07:00
shuffle.c
shuffle.h
slab_common.c
slab.c mm: slab: fix potential double free in ___cache_free 2020-09-26 10:15:01 -07:00
slab.h
slob.c
slub.c mm, slub: restore initial kmem_cache flags 2020-10-03 11:28:12 -07:00
sparse-vmemmap.c
sparse.c
swap_cgroup.c
swap_slots.c
swap_state.c
swap.c mlock: fix unevictable_pgs event counts on THP 2020-09-19 13:13:38 -07:00
swapfile.c mm, THP, swap: fix allocating cluster for swapfile by mistake 2020-09-26 10:33:57 -07:00
truncate.c
usercopy.c
userfaultfd.c
util.c
vmacache.c
vmalloc.c
vmpressure.c
vmscan.c mm: fix check_move_unevictable_pages() on THP 2020-09-19 13:13:38 -07:00
vmstat.c
workingset.c
z3fold.c
zbud.c
zpool.c
zsmalloc.c
zswap.c