android_kernel_motorola_sm6375/kernel
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Yu Zhao 6ec277958f BACKPORT: mm: multi-gen LRU: kill switch
Add /sys/kernel/mm/lru_gen/enabled as a kill switch. Components that
can be disabled include:
  0x0001: the multi-gen LRU core
  0x0002: walking page table, when arch_has_hw_pte_young() returns
          true
  0x0004: clearing the accessed bit in non-leaf PMD entries, when
          CONFIG_ARCH_HAS_NONLEAF_PMD_YOUNG=y
  [yYnN]: apply to all the components above
E.g.,
  echo y >/sys/kernel/mm/lru_gen/enabled
  cat /sys/kernel/mm/lru_gen/enabled
  0x0007
  echo 5 >/sys/kernel/mm/lru_gen/enabled
  cat /sys/kernel/mm/lru_gen/enabled
  0x0005

NB: the page table walks happen on the scale of seconds under heavy memory
pressure, in which case the mmap_lock contention is a lesser concern,
compared with the LRU lock contention and the I/O congestion.  So far the
only well-known case of the mmap_lock contention happens on Android, due
to Scudo [1] which allocates several thousand VMAs for merely a few
hundred MBs.  The SPF and the Maple Tree also have provided their own
assessments [2][3].  However, if walking page tables does worsen the
mmap_lock contention, the kill switch can be used to disable it.  In this
case the multi-gen LRU will suffer a minor performance degradation, as
shown previously.

Clearing the accessed bit in non-leaf PMD entries can also be disabled,
since this behavior was not tested on x86 varieties other than Intel and
AMD.
Moto-CRs-Fixed:(CR)

[1] https://source.android.com/devices/tech/debug/scudo
[2] https://lore.kernel.org/r/20220128131006.67712-1-michel@lespinasse.org/
[3] https://lore.kernel.org/r/20220426150616.3937571-1-Liam.Howlett@oracle.com/

Link: https://lkml.kernel.org/r/20220918080010.2920238-11-yuzhao@google.com
Change-Id: If3116e6698cc6967b6992c2017962fac6c2d3a11
Signed-off-by: Yu Zhao <yuzhao@google.com>
Acked-by: Brian Geffon <bgeffon@google.com>
Acked-by: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
Acked-by: Oleksandr Natalenko <oleksandr@natalenko.name>
Acked-by: Steven Barrett <steven@liquorix.net>
Acked-by: Suleiman Souhlal <suleiman@google.com>
Tested-by: Daniel Byrne <djbyrne@mtu.edu>
Tested-by: Donald Carr <d@chaos-reins.com>
Tested-by: Holger Hoffstätte <holger@applied-asynchrony.com>
Tested-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Tested-by: Shuang Zhai <szhai2@cs.rochester.edu>
Tested-by: Sofia Trinh <sofia.trinh@edi.works>
Tested-by: Vaibhav Jain <vaibhav@linux.ibm.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Cc: Barry Song <baohua@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Hillf Danton <hdanton@sina.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Miaohe Lin <linmiaohe@huawei.com>
Cc: Michael Larabel <Michael@MichaelLarabel.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: M(CR) Rapoport <rppt@kernel.org>
Cc: M(CR) Rapoport <rppt@linux.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Qi Zheng <zhengqi.arch@bytedance.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
(cherry picked from commit 354ed597442952fb680c9cafc7e4eb8a76f9514c)
Bug: 261052246
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
Reviewed-on: https://gerrit.mot.com/2491803
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2024-04-18 14:45:15 +08:00
..
bpf Merge a4628a5b98 ("scsi: qla2xxx: Fix deletion race condition") into android11-5.4-lts 2023-10-24 16:09:19 +00:00
cgroup BACKPORT: mm: multi-gen LRU: kill switch 2024-04-18 14:45:15 +08:00
configs
debug treewide: Replace DECLARE_TASKLET() with DECLARE_TASKLET_OLD() 2023-04-20 12:07:32 +02:00
dma Merge android11-5.4.249+ (d57e792) into msm-5.4 2023-09-28 16:45:28 +05:30
events Merge android11-5.4.254+ (91f7025) into msm-5.4 2023-10-30 22:46:41 -07:00
gcov gcov: add support for checksum field 2023-01-18 11:41:42 +01:00
irq Merge android11-5.4.249+ (d57e792) into msm-5.4 2023-09-28 16:45:28 +05:30
livepatch This is the 5.4.220 stable release 2022-10-29 10:45:08 +02:00
locking Merge android11-5.4.249+ (d57e792) into msm-5.4 2023-09-28 16:45:28 +05:30
power PM/Suspend:Print wall time at suspend entry and exit 2024-04-18 14:44:57 +08:00
printk printk: increase log buffer size to 2k 2024-04-18 14:44:58 +08:00
rcu Merge android11-5.4.242+(e699d54) into msm-5.4 2023-07-26 14:21:25 +05:30
sched BACKPORT: mm: multi-gen LRU: support page table walks 2024-04-18 14:45:15 +08:00
time (CR): alarmtimer: add debug to identify alarmtimers 2024-04-18 14:44:57 +08:00
trace tracing: do not leak kernel addresses 2024-04-18 14:45:02 +08:00
.gitignore This is the 5.4.118 stable release 2021-05-11 16:56:33 +02:00
acct.c acct: fix potential integer overflow in encode_comp_t() 2023-01-18 11:41:34 +01:00
async.c treewide: Remove uninitialized_var() usage 2023-06-09 10:29:01 +02:00
audit.c treewide: Remove uninitialized_var() usage 2023-06-09 10:29:01 +02:00
audit.h audit: log AUDIT_TIME_* records only from rules 2022-04-15 14:18:04 +02:00
audit_fsnotify.c audit: fix potential double free on error path from fsnotify_add_inode_mark 2022-09-05 10:27:38 +02:00
audit_tree.c audit: move put_tree() to avoid trim_trees refcount underflow and UAF 2021-09-03 10:08:16 +02:00
audit_watch.c audit: CONFIG_CHANGE don't log internal bookkeeping as an event 2020-10-01 13:17:32 +02:00
auditfilter.c
auditsc.c audit: fix possible soft lockup in __audit_inode_child() 2023-09-23 10:59:46 +02:00
backtracetest.c treewide: Replace DECLARE_TASKLET() with DECLARE_TASKLET_OLD() 2023-04-20 12:07:32 +02:00
bounds.c BACKPORT: mm: multi-gen LRU: minimal implementation 2024-04-18 14:45:14 +08:00
capability.c
cfi.c ANDROID: cfi: ensure RCU is watching in __cfi_slowpath 2020-11-02 18:55:52 +00:00
compat.c sched_getaffinity: don't assume 'cpumask_size()' is fully initialized 2023-04-05 11:16:42 +02:00
configs.c
context_tracking.c
cpu.c Merge android11-5.4.219+ (0ce03d1) into msm-5.4 2023-01-27 00:57:29 +05:30
cpu_pm.c
crash_core.c
crash_dump.c
cred.c
delayacct.c
dma.c
exec_domain.c
exit.c BACKPORT: mm: multi-gen LRU: support page table walks 2024-04-18 14:45:15 +08:00
extable.c kernel/extable.c: use address-of operator on section symbols 2023-06-09 10:29:01 +02:00
fail_function.c kernel/fail_function: fix memory leak with using debugfs_lookup() 2023-03-11 16:44:15 +01:00
fork.c BACKPORT: mm: multi-gen LRU: support page table walks 2024-04-18 14:45:15 +08:00
freezer.c
futex.c Merge 5.4.246 into android11-5.4-lts 2023-06-20 19:13:58 +00:00
gen_kheaders.sh Revert one chunk from 37432a83fa commit 2021-03-18 11:01:03 +05:30
groups.c
hung_task.c
iomem.c
irq_work.c
jump_label.c
kallsyms.c ANDROID: kallsyms: ignore ThinLTO+CFI hash suffix in kallsyms_lookup_name() 2020-09-22 20:17:26 +00:00
kcmp.c Revert "kernel/kcmp.c: Use new infrastructure to fix deadlocks in execve" 2021-01-11 14:35:18 +01:00
Kconfig.freezer
Kconfig.hz
Kconfig.locks
Kconfig.preempt
kcov.c
kexec.c
kexec_core.c kexec: fix a memory leak in crash_shrink_memory() 2023-07-27 08:37:10 +02:00
kexec_elf.c
kexec_file.c kexec: support purgatories with .text.hot sections 2023-06-21 15:44:10 +02:00
kexec_internal.h
kheaders.c kheaders: Use array declaration instead of char 2023-05-17 11:35:33 +02:00
kmod.c
kprobes.c x86/kprobes: Fix arch_check_optimized_kprobe check within optimized_kprobe range 2023-03-11 16:44:02 +01:00
ksysfs.c
kthread.c This is the 5.4.145 stable release 2021-09-12 09:54:40 +02:00
latencytop.c
Makefile kbuild: update config_data.gz only when the content of .config is changed 2021-05-11 14:04:16 +02:00
module-internal.h
module.c Revert "(CR): workaround for the error of "__symbol_put " undefined" 2024-04-18 14:45:00 +08:00
module_signature.c module: harden ELF info handling 2021-04-07 14:47:38 +02:00
module_signing.c module: harden ELF info handling 2021-04-07 14:47:38 +02:00
notifier.c kernel/notifier.c: intercept duplicate registrations to avoid infinite loops 2020-10-01 13:17:23 +02:00
nsproxy.c
padata.c
panic.c exit: Use READ_ONCE() for all oops/warn limit reads 2023-02-06 07:52:50 +01:00
params.c
pid.c Merge android11-5.4.61+ (d240b69) into msm-5.4 2020-10-09 07:27:04 -07:00
pid_namespace.c memcg: enable accounting for pids in nested pid namespaces 2021-09-22 12:26:37 +02:00
profile.c profiling: fix shift too large makes kernel panic 2022-08-25 11:18:02 +02:00
ptrace.c ptrace: Reimplement PTRACE_KILL by always sending SIGKILL 2022-06-14 18:11:24 +02:00
range.c
reboot.c This is the 5.4.78 stable release 2020-11-19 08:52:52 +01:00
relay.c relayfs: fix out-of-bounds access in relay_file_read 2023-05-17 11:35:58 +02:00
resource.c
rseq.c
scs.c
seccomp.c seccomp: Invalidate seccomp mode to catch death failures 2022-02-16 12:52:53 +01:00
signal.c Merge android11-5.4.210+ (7e6cbbe) into msm-5.4 2022-10-14 12:09:01 +05:30
smp.c Merge android11-5.4.191+ (375c2e2) into msm-5.4 2022-06-09 11:43:23 +05:30
smpboot.c kthread: Extract KTHREAD_IS_PER_CPU 2021-02-07 15:35:49 +01:00
smpboot.h
softirq.c
stackleak.c
stacktrace.c
stop_machine.c
sys.c This is the 5.4.230 stable release 2023-01-25 16:08:14 +00:00
sys_ni.c Merge android11-5.4.219+ (0ce03d1) into msm-5.4 2023-01-27 00:57:29 +05:30
sysctl-test.c kernel/sysctl-test: Add null pointer test for sysctl.c:proc_dointvec() 2020-10-01 13:17:10 +02:00
sysctl.c Merge android11-5.4.259+ (81334f2) into msm-5.4 2023-12-18 15:40:18 +05:30
sysctl_binary.c
task_work.c
taskstats.c taskstats: properly account NR_KERNEL_MISC_RECLAIMABLE 2021-07-01 06:18:34 -07:00
test_kprobes.c
torture.c
tracepoint.c tracepoint: Add tracepoint_probe_register_may_exist() for BPF tracing 2021-07-14 16:53:08 +02:00
tsacct.c taskstats: Cleanup the use of task->exit_code 2022-02-23 11:59:57 +01:00
ucount.c
uid16.c
uid16.h
umh.c kernel: unit power off failed when removed charger 2024-04-18 14:45:02 +08:00
up.c Revert "smp: Fix smp_call_function_single_async prototype" 2021-05-14 15:29:26 +02:00
user-return-notifier.c
user.c
user_namespace.c
utsname.c
utsname_sysctl.c
watchdog.c Merge android11-5.4.219+ (0ce03d1) into msm-5.4 2023-01-27 00:57:29 +05:30
watchdog_hld.c watchdog/perf: more properly prevent false positives with turbo modes 2023-07-27 08:37:10 +02:00
workqueue.c Merge android11-5.4.259+ (81334f2) into msm-5.4 2023-12-18 15:40:18 +05:30
workqueue_internal.h