hi -
i mentioned NMI-based profiling the other day, and figured i'd give you
all an example of why it's useful.
block_test runs slower than expected under some circumstances. it
basically just triggers a lot of kthread_usleep() calls.
i had noticed that running with LARGE_KSTACKS would hurt performance a
lot, and i guessed that it's due to the allocator having a hard time
finding contiguous pages (which i have a fix for, so don't worry).
previously, i'd see most of the time spent in cv_unlock_irqsave() (in
the kernel), ros_syscall (in userspace), or in other places that were
right when IRQs were enabled.
with perf counters triggering NMIs instead of regular interrupts, we
can now see into that area.
first, here's the run with large stacks (note the get_cont_pages()
call). (you might need to get a large window to view this nicely)
--59.74%-- kthread_usleep
|
|--59.73%-- rendez_sleep_timeout
| |
| |--59.66%-- cv_wait
| | cv_wait_and_unlock
| | |
| | --59.65%-- sem_down
| | |
| | |--54.83%-- get_kstack
| | | |
| | | --36.82%-- get_cont_pages
| | | |
| | | --0.01%--
__page_alloc_specific
| | |
__page_init
| | |
| | |--4.78%-- trace_printk
| | | |
| | | --4.53%-- trace_vprintk
| | | |
| | | |--4.25%--
gen_backtrace
interestingly enough, here's the perf run with 1-page stacks.
--81.67%-- kthread_usleep
|
|--81.47%-- rendez_sleep_timeout
| |
| |--79.90%-- cv_wait
| | |
| | --79.87%-- cv_wait_and_unlock
| | |
| | --79.74%-- sem_down
| | |
| | |--79.22%-- trace_printk
| | | |
| | | --76.56%--
trace_vprintk
| | | |
| | |
|--73.24%-- gen_backtrace
| | | |
|
| | | |
--72.93%-- print_backtrace_list
sem_down() is spending a lot of time in trace_printk. i wouldn't have
guessed that, and didn't even remember that being there...
it turns out that if you build with CONFIG_SEM_TRACE_BLOCKERS, there's
a TRACE_ME call that dumps a backtrace into a log file. it used to
generate a backtrace in our 'op2' format, the result of which could be
fed to pprof. but now it's just printing a backtrace into a kernel log
that no one reads.
we don't need any of that anymore, but it wouldn't have popped up as a
problem without the NMI profiling. (patchset pending).
barret
--
You received this message because you are subscribed to the Google Groups
"Akaros" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.