android_kernel_motorola_sm6375/include
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Carlos Galo de3f6e7a84 mm: update mark_victim tracepoints fields
[ Upstream commit 72ba14deb40a9e9668ec5e66a341ed657e5215c2 ]

The current implementation of the mark_victim tracepoint provides only the
process ID (pid) of the victim process.  This limitation poses challenges
for userspace tools requiring real-time OOM analysis and intervention.
Although this information is available from the kernel logs, it’s not
the appropriate format to provide OOM notifications.  In Android, BPF
programs are used with the mark_victim trace events to notify userspace of
an OOM kill.  For consistency, update the trace event to include the same
information about the OOMed victim as the kernel logs.

- UID
   In Android each installed application has a unique UID. Including
   the `uid` assists in correlating OOM events with specific apps.

- Process Name (comm)
   Enables identification of the affected process.

- OOM Score
  Will allow userspace to get additional insight of the relative kill
  priority of the OOM victim. In Android, the oom_score_adj is used to
  categorize app state (foreground, background, etc.), which aids in
  analyzing user-perceptible impacts of OOM events [1].

- Total VM, RSS Stats, and pgtables
  Amount of memory used by the victim that will, potentially, be freed up
  by killing it.

[1] https://cs.android.com/android/platform/superproject/main/+/246dc8fc95b6d93afcba5c6d6c133307abb3ac2e:frameworks/base/services/core/java/com/android/server/am/ProcessList.java;l=188-283
Signed-off-by: Carlos Galo <carlosgalo@google.com>
Reviewed-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: "Masami Hiramatsu (Google)" <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Stable-dep-of: ade81479c7dd ("memcg: fix soft lockup in the OOM process")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-03-13 12:43:21 +01:00
..
acpi
asm-generic
clocksource
crypto
drm drm/printer: Allow NULL data in devcoredump printer 2024-11-08 16:20:39 +01:00
dt-bindings
keys
kvm
linux pps: Fix a use-after-free 2025-03-13 12:43:19 +01:00
math-emu
media
misc
net net: add dev_net_rcu() helper 2025-03-13 12:43:17 +01:00
pcmcia
ras
rdma
scsi
soc soc: fsl: qbman: Add CGR update function 2024-04-13 12:51:27 +02:00
sound
target
trace mm: update mark_victim tracepoints fields 2025-03-13 12:43:21 +01:00
uapi netfilter: Replace zero-length array with flexible-array member 2025-01-09 13:23:35 +01:00
vdso
video
xen xen/xenbus: fix locking 2024-12-14 19:44:47 +01:00