* init_kprobes() takes too much time during boot up
@ 2011-12-23 3:06 Eric Miao
2011-12-23 3:20 ` Nicolas Pitre
0 siblings, 1 reply; 4+ messages in thread
From: Eric Miao @ 2011-12-23 3:06 UTC (permalink / raw)
To: linux-arm-kernel
I was trying to improve the kernel boot performance of the boards at
my hands, while simply turning on initcall_debug, and found that
init_kprobes() won the crown of being the most hungry time gobbler.
Before I take my time to look into why it's taking so much time, I'd
post the question to the list to seek help first.
- eric
^ permalink raw reply [flat|nested] 4+ messages in thread
* init_kprobes() takes too much time during boot up
2011-12-23 3:06 init_kprobes() takes too much time during boot up Eric Miao
@ 2011-12-23 3:20 ` Nicolas Pitre
2011-12-23 11:54 ` Jon Medhurst (Tixy)
0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Pitre @ 2011-12-23 3:20 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, 23 Dec 2011, Eric Miao wrote:
> I was trying to improve the kernel boot performance of the boards at
> my hands, while simply turning on initcall_debug, and found that
> init_kprobes() won the crown of being the most hungry time gobbler.
>
> Before I take my time to look into why it's taking so much time, I'd
> post the question to the list to seek help first.
>From a quick glance, the "Lookup and populate the kprobe_blacklist"
loops certainly have the potential to be costly.
There is nothing with notable complexity in the ARM specific part.
CC'ing Tixy in case he has a better idea.
Nicolas
^ permalink raw reply [flat|nested] 4+ messages in thread
* init_kprobes() takes too much time during boot up
2011-12-23 3:20 ` Nicolas Pitre
@ 2011-12-23 11:54 ` Jon Medhurst (Tixy)
2012-01-03 9:09 ` Russell King - ARM Linux
0 siblings, 1 reply; 4+ messages in thread
From: Jon Medhurst (Tixy) @ 2011-12-23 11:54 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, 2011-12-22 at 22:20 -0500, Nicolas Pitre wrote:
> On Fri, 23 Dec 2011, Eric Miao wrote:
>
> > I was trying to improve the kernel boot performance of the boards at
> > my hands, while simply turning on initcall_debug, and found that
> > init_kprobes() won the crown of being the most hungry time gobbler.
> >
> > Before I take my time to look into why it's taking so much time, I'd
> > post the question to the list to seek help first.
>
> From a quick glance, the "Lookup and populate the kprobe_blacklist"
> loops certainly have the potential to be costly.
>
> There is nothing with notable complexity in the ARM specific part.
Linaro's kernels have CONFIG_KPROBES_SANITY_TEST enabled and I suspect
the slowness is due to these sanity tests. The reason I think this is
that I recently noticed that my kprobes test code is 1000 times slower
on a Versatile Express than on a BeagleBoard. I suspect (without much
evidence) that on SMP systems, the use of stop_machine() to set and
clear breakpoints is causing this massive delay.
I was speculating that the slowness could be due to process scheduling
not happening until the next 'tick', or buggy code waking other CPUs
from sleep.
Does Linux have some general IPI interface we could use to synchronize
CPU rather than stop_machine? All we need to do is interrupt other cores
and make them wait until we write a new instruction to memory and do a
cache flush and relevant barrier instructions. That would propagate the
work case interrupt latency across all cores and add a little to that
value to boot though.
--
Tixy
^ permalink raw reply [flat|nested] 4+ messages in thread
* init_kprobes() takes too much time during boot up
2011-12-23 11:54 ` Jon Medhurst (Tixy)
@ 2012-01-03 9:09 ` Russell King - ARM Linux
0 siblings, 0 replies; 4+ messages in thread
From: Russell King - ARM Linux @ 2012-01-03 9:09 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Dec 23, 2011 at 11:54:09AM +0000, Jon Medhurst (Tixy) wrote:
> Does Linux have some general IPI interface we could use to synchronize
> CPU rather than stop_machine? All we need to do is interrupt other cores
> and make them wait until we write a new instruction to memory and do a
> cache flush and relevant barrier instructions.
Maybe smp_call_function(). I'm not sure whether making the called
function spin until the calling CPU sets a flag is a good idea though -
that sounds like it could cause lockups by preventing other IPIs
happening. Bear in mind that calling flush_* functions from IPIs is
not a good idea because they'll want to IPI themselves - you have to
use the local_flush_* stuff instead.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-01-03 9:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-23 3:06 init_kprobes() takes too much time during boot up Eric Miao
2011-12-23 3:20 ` Nicolas Pitre
2011-12-23 11:54 ` Jon Medhurst (Tixy)
2012-01-03 9:09 ` Russell King - ARM Linux
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).