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]

[Bug runtime/20735] "soft lockup" bug on RHEL7 ppc64


https://sourceware.org/bugzilla/show_bug.cgi?id=20735

--- Comment #1 from David Smith <dsmith at redhat dot com> ---
I've been looking at this lockup, and my suspicion is that the problem lies
with the systemtap runtime grabbing the module_mutex. The module_mutex is
exported by the kernel, and the systemtap runtime grabs that mutex when calling
kallsyms_on_each_symbol(). In the lockup below, there are at least 5 systemtap
modules loaded simultaneously. When the last systemtap module got loaded, that
triggered the other 4 to get notified that a new module was loaded. That causes
the other 4 to try to grab the module_mutex to update module symbols (via
stapkp_refresh() in runtime/linux/kprobes.c). In addition, the last one loaded
could be calling stapkp_init() (runtime/linux/kprobes.c) which also tries to
grab the module mutex.

So, my suspicion is that all 5 of those modules are trying to grab that same
mutex at the same time. Plus, kallsyms_on_each_symbol() isn't quick, since it
calls a function on every kernel symbol.

Here's the comment before the module_mutex definition in kernel/module.c:

/*
 * Mutex protects:
 * 1) List of modules (also safely readable with preempt_disable),
 * 2) module_use links,
 * 3) module_addr_min/module_addr_max.
 * (delete uses stop_machine/add uses RCU list operations). */

Based on that comment, I'm going to try to see what happens if we disable
preemption before calling kallsyms_on_each_symbol() and enabling preemption
afterwards instead of using module_mutex.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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