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 translator/17055] New: _stp_perf_read needs a sleepable context


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

            Bug ID: 17055
           Summary: _stp_perf_read needs a sleepable context
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: translator
          Assignee: systemtap at sourceware dot org
          Reporter: jistone at redhat dot com

On rawhide kernel 3.16.0-0.rc0.git5.1.fc21.x86_64:

> BUG: sleeping function called from invalid context at /usr/local/share/systemtap/runtime/linux/perf.c:262
> in_atomic(): 1, irqs_disabled(): 0, pid: 20706, name: towers.x
> 1 lock held by towers.x/20706:
>  #0:  (&uprobe->register_rwsem){++++++}, at: [<ffffffff811b1a9f>] uprobe_notify_resume+0x39f/0x9a0
> CPU: 0 PID: 20706 Comm: towers.x Tainted: G           OE 3.16.0-0.rc0.git5.1.fc21.x86_64 #1
> Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
>  0000000000000000 000000004a950067 ffff880026543dc8 ffffffff817f6326
>  0000000000000000 ffff880026543df0 ffffffff810d0644 0000000000000001
>  ffffffffa03f30c0 ffffffffa03f3028 ffff880026543e20 ffffffffa03e2e42
> Call Trace:
>  [<ffffffff817f6326>] dump_stack+0x4d/0x66
>  [<ffffffff810d0644>] __might_sleep+0x184/0x240
>  [<ffffffffa03e2e42>] _stp_perf_read.isra.60.part.61+0x32/0x80 [stap_3299c82377bb59db6a0484698cffdac_20704]
>  [<ffffffffa03eb1f7>] probe_2262+0x27/0x100 [stap_3299c82377bb59db6a0484698cffdac_20704]
>  [<ffffffffa03e7739>] stapiu_probe_prehandler+0x249/0x450 [stap_3299c82377bb59db6a0484698cffdac_20704]
>  [<ffffffff811b1ad0>] uprobe_notify_resume+0x3d0/0x9a0
>  [<ffffffff81266574>] ? mntput+0x24/0x40
>  [<ffffffff810fa87d>] ? trace_hardirqs_on_caller+0x15d/0x200
>  [<ffffffff81019d30>] do_notify_resume+0x80/0x90
>  [<ffffffff81800050>] paranoid_userspace+0x4b/0x5a

There's a might_sleep() in _stp_perf_read.  This is right before calling
perf_event_read_value(), which calls mutex_lock() with its own might_sleep().

Probe handlers are never sleepable.  At a minimum, we always have
preempt_disable() as we grab the context structure.  Uprobe handlers actually
are called in a sleepable context, but we'll have to take those sleepy actions
*before* any preempt or irqsave happens, and thus before we even have a context
struct.

-- 
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]