android_kernel_motorola_sm6375/include
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
..
acpi
asm-generic This is the 5.4.265 stable release 2023-12-21 12:17:30 +00:00
clocksource
crypto Merge android11-5.4.268+ (66f4b04) into msm-5.4 2024-04-10 23:53:13 -07:00
drm This is the 5.4.285 stable release 2024-11-09 11:29:17 +00:00
dt-bindings
keys
kvm
linux BACKPORT: FROMGIT: userfaultfd/shmem: modify shmem_mfill_atomic_pte to use install_pte() 2025-05-18 08:08:42 +00:00
math-emu
media Revert "media: rename VFL_TYPE_GRABBER to _VIDEO" 2024-04-17 16:49:02 +00:00
misc
net 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
pcmcia
ras
rdma
scsi
soc Merge android11-5.4.274 (564901b) into msm-5.4 2024-07-24 20:38:43 -07:00
sound ALSA: compress: Remove redefinition 2024-01-16 11:39:15 +05:30
target
trace BACKPORT: FROMGIT: userfaultfd: add minor fault registration mode 2025-05-18 08:08:42 +00:00
uapi BACKPORT: FROMGIT: userfaultfd/shmem: advertise shmem minor fault support 2025-05-18 08:08:42 +00:00
vdso
video
xen xen/xenbus: fix locking 2024-12-14 19:44:47 +01:00
OWNERS