linux-sg2042/Documentation/trace
wuqiang d465fa2a9a kprobes: kretprobe events missing on 2-core KVM guest
[ Upstream commit 3b7ddab8a1 ]

Default value of maxactive is set as num_possible_cpus() for nonpreemptable
systems. For a 2-core system, only 2 kretprobe instances would be allocated
in default, then these 2 instances for execve kretprobe are very likely to
be used up with a pipelined command.

Here's the testcase: a shell script was added to crontab, and the content
of the script is:

  #!/bin/sh
  do_something_magic `tr -dc a-z < /dev/urandom | head -c 10`

cron will trigger a series of program executions (4 times every hour). Then
events loss would be noticed normally after 3-4 hours of testings.

The issue is caused by a burst of series of execve requests. The best number
of kretprobe instances could be different case by case, and should be user's
duty to determine, but num_possible_cpus() as the default value is inadequate
especially for systems with small number of cpus.

This patch enables the logic for preemption as default, thus increases the
minimum of maxactive to 10 for nonpreemptable systems.

Link: https://lore.kernel.org/all/20221110081502.492289-1-wuqiang.matt@bytedance.com/

Signed-off-by: wuqiang <wuqiang.matt@bytedance.com>
Reviewed-by: Solar Designer <solar@openwall.com>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-01-04 11:28:58 +01:00
..
coresight perf tools changes for v6.1: 1st batch 2022-10-11 15:02:25 -07:00
postprocess tweewide: Fix most Shebang lines 2020-12-08 23:30:04 +09:00
rv rv/monitor: Add the wwnr monitor 2022-07-30 14:01:30 -04:00
boottime-trace.rst docs/trace: fix a label of boottime-trace 2021-12-10 13:58:53 -07:00
events-kmem.rst mm/lru: revise the comments of lru_lock 2020-12-15 14:48:04 -08:00
events-msr.rst Replace HTTP links with HTTPS ones: documentation 2020-06-08 09:30:19 -06:00
events-nmi.rst trace doc: convert trace/events-nmi.txt to rst format 2018-03-07 10:26:02 -07:00
events-power.rst PM: QoS: Simplify definitions of CPU latency QoS trace events 2020-02-13 11:26:39 +01:00
events.rst tracing: Add ustring operation to filtering string pointers 2022-01-14 03:42:24 -05:00
fprobe.rst docs: fprobe: Add fprobe description to ftrace-use.rst 2022-03-17 20:17:08 -07:00
ftrace-design.rst sh/ftrace: Move arch_ftrace_nmi_{enter,exit} into nmi exception 2020-05-19 15:51:18 +02:00
ftrace-uses.rst ftrace/documentation: Fix RST C code blocks 2020-11-18 11:45:23 -05:00
ftrace.rst docs: ftrace: Correct access mode 2022-10-10 12:50:53 -06:00
function-graph-fold.vim
hisi-ptt.rst docs: trace: Add HiSilicon PTT device driver documentation 2022-09-08 18:41:22 -06:00
histogram-design.rst Documentation: trace/histogram-design: drop doubled words 2020-07-05 14:40:55 -06:00
histogram.rst tracing/histogram: Update document for KEYS_MAX size 2022-10-18 15:41:56 -06:00
hwlat_detector.rst trace/hwlat: Implement the per-cpu mode 2021-06-25 18:23:22 -04:00
index.rst docs: trace: Add HiSilicon PTT device driver documentation 2022-09-08 18:41:22 -06:00
intel_th.rst docs: trace: fix a typo 2020-08-11 10:22:15 -06:00
kprobes.rst kprobes: kretprobe events missing on 2-core KVM guest 2023-01-04 11:28:58 +01:00
kprobetrace.rst tracing: Auto generate event name when creating a group of events 2022-07-24 19:11:17 -04:00
mmiotrace.rst Replace HTTP links with HTTPS ones: documentation 2020-06-08 09:30:19 -06:00
osnoise-tracer.rst docs: Remove duplicated words in trace/osnoise-tracer 2022-02-24 10:42:20 -07:00
ring-buffer-design.rst docs: trace: ring-buffer-design.rst: use the new SPDX tag 2020-09-24 11:07:44 -06:00
stm.rst Documentation: trace/stm: drop doubled words 2020-07-05 14:40:55 -06:00
sys-t.rst stm class: Document the MIPI SyS-T protocol usage 2018-10-11 12:12:55 +02:00
timerlat-tracer.rst Delete duplicate words from kernel docs 2022-09-27 13:21:43 -06:00
tracepoint-analysis.rst docs: Fix some broken references 2018-06-15 18:10:01 -03:00
tracepoints.rst tracepoints: Add helper to test if tracepoint is enabled in a header 2020-09-25 18:01:35 -04:00
uprobetracer.rst tracing: Auto generate event name when creating a group of events 2022-07-24 19:11:17 -04:00
user_events.rst tracing/user_events: Update ABI documentation to align to bits vs bytes 2022-09-29 10:17:37 -04:00