This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC][PATCH][kprobe] enabling booster on the preemptible kernel, take 2


Masami Hiramatsu wrote:
Hi bibo,

Thank you for your review!

bibo,mao wrote:
This patch will boost kprobe on preemptible kernel, I think
it is deserved to waster some memory for better performance
by deferring memory free after freeze_processes.

I think it doesn't waste memory so much, because it tries to reuse garbage memories before the kernel allocates an additional page.

[...]
+static int __kprobes collect_garbage_slots(void)
+{
+       struct kprobe_insn_page *kip;
+       struct hlist_node *pos, *next;
+       int ret = -1;
+
+#if defined(CONFIG_PREEMPT) && defined(CONFIG_PM)
+       /* Ensure no-one is preepmted on the garbages */
+       if (freeze_processes() != 0)
I do not know whether there exists non-freezeable and preemptive kernel
thread, if there exist then this thread will not be frozen.

In that case, freeze_processes() returns the positive value which means how many processes are not frozen. If freeze_processes() returns non-zero, this function aborts the garbage collection.

But from the code, return value of freeze_processes() represents how many
processes can be frozen but are not frozen. I grep the kernel code, there
still exists many processes which flag is PF_NOFREEZE.
I think if current probed thread is PF_NOFREEZE, then kprobe_handler need skip the bootser.


thanks
bibo,mao


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]