On Thu 2016-07-14 16:50:29, Chris Metcalf wrote:
Currently you can only request a backtrace of either all cpus, orI triggered this function using
all cpus but yourself. It can also be helpful to request a remote
backtrace of a single cpu, and since we want that, the logical
extension is to support a cpumask as the underlying primitive.
This change modifies the existing lib/nmi_backtrace.c code to take
a cpumask as its basic primitive, and modifies the linux/nmi.h code
to use either the old "all/all_but_self" arch methods, or the new
"cpumask" method, depending on which is available.
echo l >/proc/sysrq-trigger
and got
[ 270.791328] ----------- All but itself: ---------------------
[ 270.791331] ===============================
[ 270.791331] [ INFO: suspicious RCU usage. ]
[ 270.791333] 4.8.0-rc1-4-default+ #3086 Not tainted
[ 270.791333] -------------------------------
[ 270.791335] ./include/linux/rcupdate.h:556 Illegal context switch in RCU read-side critical section!
+ cpumask_copy(mask, cpu_online_mask);Also this looks too much code for an inlined function.
+ cpumask_clear_cpu(cpu, mask);
+ arch_trigger_cpumask_backtrace(mask);
+ put_cpu();
+ free_cpumask_var(mask);
+ return true;
It is rather slow and there is not a big gain. I would move
the definition to lib/nmi_backtrace.c.
PS: I am sorry for sending this so late in the game. I was
curious why the patch had not been upstream yet and. I made
a closer look to give a Reviewed-by tag...