linux-stable/Documentation/trace
wuqiang 2b7e6a0734 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:26:27 +01:00
..
coresight coresight: docs: Fix a broken reference 2022-10-21 12:38:39 +02:00
postprocess
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
events-msr.rst
events-nmi.rst
events-power.rst
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
ftrace-uses.rst
ftrace.rst tracing: Add documentation for trace clock tai 2022-04-27 17:19:30 -04:00
function-graph-fold.vim
histogram-design.rst
histogram.rst tracing/histogram: Update document for KEYS_MAX size 2022-11-10 18:17:33 +01:00
hwlat_detector.rst
index.rst Documentation/rv: Add a basic documentation 2022-07-30 14:01:29 -04:00
intel_th.rst
kprobes.rst kprobes: kretprobe events missing on 2-core KVM guest 2023-01-04 11:26:27 +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
osnoise-tracer.rst docs: Remove duplicated words in trace/osnoise-tracer 2022-02-24 10:42:20 -07:00
ring-buffer-design.rst
stm.rst
sys-t.rst
timerlat-tracer.rst tracing/timerlat: Print stacktrace in the IRQ handler if needed 2022-05-26 21:13:00 -04:00
tracepoint-analysis.rst
tracepoints.rst
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: Remove eBPF interfaces 2022-04-02 08:40:09 -04:00