public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kretprobe events missing on 2-core KVM guest
@ 2022-10-25 10:01 wuqiang
  2022-10-25 15:33 ` Masami Hiramatsu
  0 siblings, 1 reply; 7+ messages in thread
From: wuqiang @ 2022-10-25 10:01 UTC (permalink / raw)
  To: mhiramat, davem, anil.s.keshavamurthy, naveen.n.rao
  Cc: linux-kernel, mattwu, wuqiang

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.

This patch increases the minimum of maxactive to 10.

Signed-off-by: wuqiang <wuqiang.matt@bytedance.com>
---
 kernel/kprobes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index 3220b0a2fb4a..b781dee3f552 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -2211,7 +2211,7 @@ int register_kretprobe(struct kretprobe *rp)
 #ifdef CONFIG_PREEMPTION
 		rp->maxactive = max_t(unsigned int, 10, 2*num_possible_cpus());
 #else
-		rp->maxactive = num_possible_cpus();
+		rp->maxactive = max_t(unsigned int, 10, num_possible_cpus());
 #endif
 	}
 #ifdef CONFIG_KRETPROBE_ON_RETHOOK
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-11-14  5:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-25 10:01 [PATCH] kretprobe events missing on 2-core KVM guest wuqiang
2022-10-25 15:33 ` Masami Hiramatsu
2022-11-07 13:36   ` Solar Designer
2022-11-08  2:50     ` wuqiang
2022-11-10  8:15   ` [PATCH v2] kprobes: " wuqiang
2022-11-10 14:52     ` Solar Designer
2022-11-14  5:45       ` Masami Hiramatsu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox