android_kernel_motorola_sm6375/mm
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Axel Rasmussen f98960cd4b BACKPORT: FROMGIT: userfaultfd/shmem: modify shmem_mfill_atomic_pte to use install_pte()
In a previous commit, we added the mfill_atomic_install_pte() helper.
This helper does the job of setting up PTEs for an existing page, to map
it into a given VMA.  It deals with both the anon and shmem cases, as well
as the shared and private cases.

In other words, shmem_mfill_atomic_pte() duplicates a case it already
handles.  So, expose it, and let shmem_mfill_atomic_pte() use it directly,
to reduce code duplication.

This requires that we refactor shmem_mfill_atomic_pte() a bit:

Instead of doing accounting (shmem_recalc_inode() et al) part-way through
the PTE setup, do it afterward.  This frees up mfill_atomic_install_pte()
from having to care about this accounting, and means we don't need to e.g.
shmem_uncharge() in the error path.

A side effect is this switches shmem_mfill_atomic_pte() to use
lru_cache_add_inactive_or_unevictable() instead of just lru_cache_add().
This wrapper does some extra accounting in an exceptional case, if
appropriate, so it's actually the more correct thing to use.

Link: https://lkml.kernel.org/r/20210503180737.2487560-7-axelrasmussen@google.com
Signed-off-by: Axel Rasmussen <axelrasmussen@google.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Acked-by: Hugh Dickins <hughd@google.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Brian Geffon <bgeffon@google.com>
Cc: "Dr . David Alan Gilbert" <dgilbert@redhat.com>
Cc: Jerome Glisse <jglisse@redhat.com>
Cc: Joe Perches <joe@perches.com>
Cc: Kirill A. Shutemov <kirill@shutemov.name>
Cc: Lokesh Gidra <lokeshgidra@google.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
Cc: Mina Almasry <almasrymina@google.com>
Cc: Oliver Upton <oupton@google.com>
Cc: Shaohua Li <shli@fb.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Wang Qing <wangqing@vivo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
(cherry picked from commit 42660ee254d889478c4d12929875f4d0ab067ca4
https: //git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
akpm)
Link: https://lore.kernel.org/patchwork/patch/1420973/

Conflicts:
1. mm/shmem.c
2. mm/userfaultfd.c
(1. Incorporated mem_cgroup_try_charge() into the patch
2. Manual rebase)

Signed-off-by: Lokesh Gidra <lokeshgidra@google.com>
Bug: 187930641
Change-Id: I130c9f7cdfe0404dbd7bed48f19eddec65ea1c48
2025-05-18 08:08:42 +00:00
..
kasan Merge android11-5.4.233+ (4716ccc) into msm-5.4 2023-05-30 11:16:10 +05:30
backing-dev.c mm: bdi: initialize bdi_min_ratio when bdi is unregistered 2021-12-14 14:49:00 +01:00
balloon_compaction.c
cleancache.c
cma.c Merge android11-5.4.265+ (a34cc1d) into msm-5.4 2024-02-29 15:10:56 +05:30
cma.h
cma_debug.c Revert "Revert "mm: cma: make writeable CMA debugfs optional"" 2020-12-17 15:22:06 +05:30
compaction.c Merge tag 'ASB-2024-06-05_11-5.4' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina 2024-06-22 17:58:09 +03:00
debug.c mm/debug.c: always print flags in dump_page() 2020-03-05 16:43:51 +01:00
debug_page_ref.c
dmapool.c
early_ioremap.c
fadvise.c
failslab.c
filemap.c Merge android11-5.4.259+ (81334f2) into msm-5.4 2023-12-18 15:40:18 +05:30
frame_vector.c v4l2: don't fall back to follow_pfn() if pin_user_pages_fast() fails 2022-12-08 11:23:06 +01:00
frontswap.c treewide: Remove uninitialized_var() usage 2023-06-09 10:29:01 +02:00
gup.c Merge android11-5.4.233+ (4716ccc) into msm-5.4 2023-05-30 11:16:10 +05:30
gup_benchmark.c
highmem.c
hmm.c
huge_memory.c Merge android11-5.4.242+(e699d54) into msm-5.4 2023-07-26 14:21:25 +05:30
hugetlb.c BACKPORT: FROMLIST: userfaultfd/hugetlbfs: Fix minor fault page leak 2025-05-18 08:08:42 +00:00
hugetlb_cgroup.c
hwpoison-inject.c
init-mm.c mm: protect mm_rb tree with a rwlock 2020-06-11 16:02:05 +05:30
internal.h Merge android11-5.4.134+ (dca02b1) into msm-5.4 2021-10-06 09:48:07 +05:30
interval_tree.c
Kconfig Merge android11-5.4.86+ (75c93eb) into msm-5.4 2021-04-22 09:44:51 +05:30
Kconfig.debug mm, page_owner: set page owner info for tail pages 2020-02-27 15:13:14 -08:00
khugepaged.c Merge tag 'LA.UM.9.14.r1-21600-LAHAINA.QSSI14.0' of https://git.codelinaro.org/clo/la/kernel/msm-5.4 into android13-5.4-lahaina 2023-06-08 11:39:35 +03:00
kmemleak-test.c
kmemleak.c Revert "mm: kmemleak: take a full lowmem check in kmemleak_*_phys()" 2022-09-15 12:04:49 +02:00
ksm.c Merge android11-5.4.249+ (d57e792) into msm-5.4 2023-09-28 16:45:28 +05:30
list_lru.c mm: list_lru: set shrinker map bit when child nr_items is not zero 2020-12-11 13:23:31 +01:00
maccess.c
madvise.c Merge tag 'ASB-2024-11-05_11-5.4' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina 2024-11-08 15:36:32 +00:00
Makefile Merge tag 'ASB-2024-05-05_11-5.4' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina 2024-05-07 20:29:15 +03:00
memblock.c This is the 5.4.232 stable release 2023-02-22 12:30:48 +00:00
memcontrol.c memcg: fix soft lockup in the OOM process 2025-03-13 12:43:21 +01:00
memfd.c memfd: fix F_SEAL_WRITE after shmem huge page allocated 2022-03-08 19:07:49 +01:00
memory-failure.c Merge 5.4.274 into android11-5.4-lts 2024-04-18 07:23:10 +00:00
memory.c BACKPORT: FROMGIT: userfaultfd/shmem: support minor fault registration for shmem 2025-05-18 08:08:42 +00:00
memory_hotplug.c Merge android11-5.4.161+ (b9d179c) into msm-5.4 2022-02-07 22:29:21 +05:30
mempolicy.c Merge android11-5.4.249+ (d57e792) into msm-5.4 2023-09-28 16:45:28 +05:30
mempool.c
memremap.c
memtest.c memtest: use {READ,WRITE}_ONCE in memory scanning 2024-04-13 12:51:27 +02:00
migrate.c Merge tag 'ASB-2024-06-05_11-5.4' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina 2024-06-22 17:58:09 +03:00
mincore.c
mlock.c Merge tag 'ASB-2024-05-05_11-5.4' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina 2024-05-07 20:29:15 +03:00
mm_init.c
mmap.c BACKPORT: FROMLIST: Revert "mremap: don't allow MREMAP_DONTUNMAP on special_mappings and aio" 2025-05-18 08:08:42 +00:00
mmu_context.c mm: fix kthread_use_mm() vs TLB invalidate 2020-09-03 11:26:51 +02:00
mmu_gather.c mm/khugepaged: fix GUP-fast interaction by sending IPI 2022-12-14 11:30:42 +01:00
mmu_notifier.c
mmzone.c arm: remove CONFIG_ARCH_HAS_HOLES_MEMORYMODEL 2022-05-15 19:54:46 +02:00
mprotect.c Merge tag 'ASB-2024-05-05_11-5.4' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina 2024-05-07 20:29:15 +03:00
mremap.c UPSTREAM: mm/mremap: don't account pages in vma_to_resize() 2025-05-18 08:08:42 +00:00
msync.c
nommu.c x86/mm: split vmalloc_sync_all() 2020-03-25 08:25:58 +01:00
oom_kill.c Merge tag 'ASB-2025-05-05_11-5.4' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina 2025-05-18 08:00:20 +00:00
OWNERS ANDROID: Add OWNERS files referring to the respective android-mainline OWNERS 2021-04-01 13:45:14 +00:00
page-writeback.c mm: avoid overflows in dirty throttling logic 2024-08-19 05:33:42 +02:00
page_alloc.c Merge tag 'ASB-2025-05-05_11-5.4' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina 2025-05-18 08:00:20 +00:00
page_counter.c Revert "ANDROID: Revert: Merge 5.4.60 into android11-5.4" 2020-08-23 13:12:51 +02:00
page_ext.c mm: fix the page_owner initializing issue for arm32 2020-09-29 12:42:42 +08:00
page_idle.c BACKPORT: mm: don't be stuck to rmap lock on reclaim path 2023-01-13 08:56:32 +00:00
page_io.c Merge android11-5.4.197+ (3970bc6) into msm-5.4 2022-08-16 16:52:01 +05:30
page_isolation.c mm/memory_hotplug: drain per-cpu pages again during memory offline 2020-11-23 17:03:25 +05:30
page_owner.c mm: page_owner: Fix -Wstrlcpy-strlcat-size 2025-04-26 21:17:21 +03:00
page_poison.c debug-pagealloc: Panic on pagealloc corruption 2020-08-25 11:46:48 -07:00
page_vma_mapped.c mm/thp: another PVMW_SYNC fix in page_vma_mapped_walk() 2021-06-30 08:47:55 -04:00
pagewalk.c mm: pagewalk: Fix race between unmap and page walker 2022-10-15 07:54:36 +02:00
percpu-internal.h
percpu-km.c
percpu-stats.c
percpu-vm.c
percpu.c treewide: Remove uninitialized_var() usage 2023-06-09 10:29:01 +02:00
pgsize_migration.c ANDROID: 16K: Introduce pgsize_migration_inline.h 2024-10-10 16:13:30 -07:00
pgtable-generic.c mm/thp: fix __split_huge_pmd_locked() on shmem migration entry 2021-06-30 08:47:52 -04:00
process_vm_access.c
readahead.c vfs: fix readahead(2) on block devices 2023-11-20 10:30:08 +01:00
rmap.c Merge android11-5.4.242+(e699d54) into msm-5.4 2023-07-26 14:21:25 +05:30
rodata_test.c
shmem.c BACKPORT: FROMGIT: userfaultfd/shmem: modify shmem_mfill_atomic_pte to use install_pte() 2025-05-18 08:08:42 +00:00
showmem.c
shuffle.c mm/shuffle: don't move pages between zones and don't read garbage memmaps 2020-09-03 11:26:51 +02:00
shuffle.h
slab.c soc: qcom: Enable slabinfo support in minidump 2020-09-07 09:23:52 -07:00
slab.h mm: kmemleak: slob: respect SLAB_NOLEAKTRACE flag 2021-11-26 10:47:21 +01:00
slab_common.c Merge tag 'ASB-2024-12-05_11-5.4' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina 2024-12-17 03:24:53 +02:00
slob.c UPSTREAM: mm/sl[uo]b: export __kmalloc_track(_node)_caller 2020-11-02 16:12:00 +00:00
slub.c mm: slub: Declare slab_owner_ops only when SLUB DEBUG is enabled 2024-01-18 01:32:07 -08:00
sparse-vmemmap.c
sparse.c mm/sparse: add the missing sparse_buffer_fini() in error branch 2021-05-14 09:44:32 +02:00
swap.c Merge android11-5.4.249+ (d57e792) into msm-5.4 2023-09-28 16:45:28 +05:30
swap_cgroup.c
swap_slots.c
swap_state.c Merge android11-5.4.86+ (75c93eb) into msm-5.4 2021-04-22 09:44:51 +05:30
swapfile.c This is the 5.4.285 stable release 2024-11-09 11:29:17 +00:00
truncate.c mm/thp: unmap_mapping_page() to fix THP truncate_cleanup_page() 2021-06-30 08:47:53 -04:00
usercopy.c Merge android11-5.4.191+ (375c2e2) into msm-5.4 2022-06-09 11:43:23 +05:30
userfaultfd.c BACKPORT: FROMGIT: userfaultfd/shmem: modify shmem_mfill_atomic_pte to use install_pte() 2025-05-18 08:08:42 +00:00
util.c mm: only enforce minimum stack gap size if it's sensible 2024-11-08 16:20:35 +01:00
vmacache.c
vmalloc.c mm: vmalloc: prevent use after free in _vm_unmap_aliases 2021-07-29 20:47:17 -07:00
vmpressure.c
vmscan.c Merge tag 'ASB-2025-02-05_11-5.4' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina 2025-02-06 22:53:05 +02:00
vmstat.c Merge android11-5.4.197+ (3970bc6) into msm-5.4 2022-08-16 16:52:01 +05:30
workingset.c mm: workingset: remove zero-seek setting for shadow node shrinker 2020-04-06 23:51:59 -07:00
z3fold.c mm/z3fold: fix potential memory leak in z3fold_destroy_pool() 2021-07-14 16:53:47 +02:00
zbud.c
zpool.c
zsmalloc.c Merge android11-5.4.197+ (3970bc6) into msm-5.4 2022-08-16 16:52:01 +05:30
zswap.c