linux-stable/Documentation
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
..
ABI mtd: spi-nor: hide jedec_id sysfs attribute if not present 2022-12-31 13:26:00 +01:00
accounting
admin-guide x86/split_lock: Add sysctl to control the misery mode 2022-12-31 13:25:42 +01:00
arc
arm SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
arm64 arm64: errata: Add Cortex-A55 to the repeat tlbi list 2022-10-21 12:37:42 +02:00
block Documentation: document ublk 2022-09-02 09:31:15 -06:00
bpf bpf: Update bpf_design_QA.rst to clarify that BTF_ID does not ABIify a function 2022-08-04 13:17:24 -07:00
cdrom
core-api Bitmap patches for v6.0-rc1 2022-08-07 17:52:35 -07:00
cpu-freq
crypto
dev-tools - The usual batches of cleanups from Baoquan He, Muchun Song, Miaohe 2022-08-05 16:32:45 -07:00
devicetree dt-bindings: input: iqs7222: Add support for IQS7222A v1.13+ 2022-12-31 13:26:50 +01:00
doc-guide
driver-api spi: Update reference to struct spi_controller 2022-12-31 13:25:53 +01:00
fault-injection debugfs: fix error when writing negative value to atomic_t debugfs file 2022-12-31 13:25:45 +01:00
fb
features Xtensa updates for v5.20 2022-08-04 15:35:58 -07:00
filesystems fs: record I_DIRTY_TIME even if inode already has I_DIRTY_INODE 2022-10-21 12:37:47 +02:00
firmware-guide Documentation: ACPI: EINJ: Fix obsolete example 2022-07-21 17:05:42 +02:00
firmware_class
fpga
gpu Merge tag 'amd-drm-next-5.20-2022-07-26' of https://gitlab.freedesktop.org/agd5f/linux into drm-next 2022-07-27 09:33:45 +10:00
hid
hwmon This was a moderately busy cycle for documentation, but nothing all that 2022-08-02 19:24:24 -07:00
i2c Documentation: i2c: fix references to other documents 2022-09-16 20:53:58 +01:00
ia64
iio
images
infiniband
input Input: iforce - add support for Boeder Force Feedback Wheel 2022-08-29 11:45:28 -07:00
isdn
kbuild asm goto: eradicate CC_HAS_ASM_GOTO 2022-08-21 10:06:28 -07:00
kernel-hacking docs: process: remove outdated submitting-drivers.rst 2022-07-14 15:03:57 -06:00
leds
litmus-tests
livepatch
locking
loongarch docs/LoongArch: Add I14 description 2022-08-12 13:10:11 +08:00
m68k video: fbdev: atari: Fix inverse handling 2022-07-18 07:56:17 +02:00
maintainer
mhi
mips
misc-devices
mm Documentation/mm: add details about kmap_local_page() and preemption 2022-08-08 18:06:46 -07:00
netlabel
networking netfilter: conntrack: remove nf_conntrack_helper documentation 2022-09-20 23:50:03 +02:00
nios2
nvdimm
openrisc
parisc
PCI Fix of heap data and clang warnings, support for a new Intel NTB device, 2022-08-13 14:00:45 -07:00
pcmcia
peci
power Merge branches 'pm-devfreq', 'pm-qos', 'pm-tools' and 'pm-docs' 2022-07-29 19:46:00 +02:00
powerpc docs: powerpc: add elf_hwcaps to table of contents 2022-07-28 16:19:47 +10:00
process docs: update mediator contact information in CoC doc 2022-11-26 09:27:50 +01:00
RCU
riscv
s390 s390/docs: fix warnings for vfio_ap driver doc 2022-07-22 13:54:07 +02:00
scheduler
scsi SCSI misc on 20220804 2022-08-04 19:47:37 -07:00
security KEYS: encrypted: fix key instantiation with user-provided data 2022-12-21 17:41:15 +01:00
sh
sound
sparc
sphinx docs: kerneldoc-preamble: Test xeCJK.sty before loading 2022-08-18 11:27:55 -06:00
sphinx-static
spi
staging
target
timers
tools rtla: Fix tracer name 2022-08-10 11:43:59 -04:00
trace kprobes: kretprobe events missing on 2-core KVM guest 2023-01-04 11:26:27 +01:00
translations docs/process/howto: Replace C89 with C11 2022-11-10 18:17:15 +01:00
usb
userspace-api SCSI misc on 20220804 2022-08-04 19:47:37 -07:00
virt KVM: s390: pv: don't allow userspace to set the clock under PV 2022-11-16 10:03:54 +01:00
w1
watchdog watchdog/pseries-wdt: initial support for H_WATCHDOG-based watchdog timers 2022-07-20 21:57:39 +10:00
x86 dma-mapping updates 2022-08-06 10:56:45 -07:00
xtensa
.gitignore
arch.rst
asm-annotations.rst
atomic_bitops.txt wait_on_bit: add an acquire memory barrier 2022-08-26 09:30:25 -07:00
atomic_t.txt
Changes
CodingStyle
conf.py docs/conf.py: add function attribute '__fix_address' to conf.py 2022-08-26 16:47:13 -06:00
docutils.conf
dontdiff
index.rst
Kconfig
Makefile
memory-barriers.txt
SubmittingPatches