[Bug translator/22312] New: bpf: global variable locking

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug translator/22312] New: bpf: global variable locking

fweimer at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22312

            Bug ID: 22312
           Summary: bpf: global variable locking
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: translator
          Assignee: systemtap at sourceware dot org
          Reporter: amerey at redhat dot com
  Target Milestone: ---

May need an explicit bpf array for lock tracking.

--
You are receiving this mail because:
You are the assignee for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug translator/22312] bpf: global variable locking

fweimer at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22312

--- Comment #1 from Aaron Merey <amerey at redhat dot com> ---
We want to implement stap's locking of globals on a per-probe basis.

--
You are receiving this mail because:
You are the assignee for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug translator/22312] bpf: global variable locking

fweimer at redhat dot com
In reply to this post by fweimer at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22312

Serhei Makarov <me at serhei dot io> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |me at serhei dot io

--- Comment #2 from Serhei Makarov <me at serhei dot io> ---
https://sourceware.org/ml/systemtap/2018-q3/msg00017.html describes one
possible way of doing this:

BPF_XADD(&lock_counter, 1);
value = read(lock_counter);
if (value <= 1) { ... execute probe ... } else skip probe
BPF_XADD(&lock_counter, -1);

--
You are receiving this mail because:
You are the assignee for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug bpf/22312] bpf: global variable locking

fweimer at redhat dot com
In reply to this post by fweimer at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22312

Serhei Makarov <me at serhei dot io> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|translator                  |bpf

--
You are receiving this mail because:
You are the assignee for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug bpf/22312] bpf: global variable and statistics aggregate locking

fweimer at redhat dot com
In reply to this post by fweimer at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22312

Serhei Makarov <me at serhei dot io> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|bpf: global variable        |bpf: global variable and
                   |locking                     |statistics aggregate
                   |                            |locking

--- Comment #3 from Serhei Makarov <me at serhei dot io> ---
Becomes especially important if we want to get exact results from statistical
aggregates (PR23476). There is some BPF upstream work (discussed at LPC 2018)
that will eventually make this easier to implement properly.

--
You are receiving this mail because:
You are the assignee for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug bpf/22312] bpf: global variable and statistics aggregate locking

fweimer at redhat dot com
In reply to this post by fweimer at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22312

--- Comment #4 from Serhei Makarov <me at serhei dot io> ---
Newer kernels will include a spinlock primitive:
https://github.com/torvalds/linux/blob/master/include/uapi/linux/bpf.h#L2346

On older kernels we may either use the XADD method or just print a warning and
skip locking altogether.

--
You are receiving this mail because:
You are the assignee for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug bpf/22312] bpf: global variable and statistics aggregate locking

fweimer at redhat dot com
In reply to this post by fweimer at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22312

Serhei Makarov <me at serhei dot io> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Depends on|                            |24528


Referenced Bugs:

https://sourceware.org/bugzilla/show_bug.cgi?id=24528
[Bug 24528] bpf-next housekeeping: bpf-translate.cxx should distinguish codegen
for kernel/userspace targets
--
You are receiving this mail because:
You are the assignee for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug bpf/22312] bpf: global variable and statistics aggregate locking

fweimer at redhat dot com
In reply to this post by fweimer at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22312

--- Comment #5 from Serhei Makarov <me at serhei dot io> ---
If we go with the 'print a warning' method, should only print if the script is
using some feature that's particularly sensitive to locking. Currently the
@variance calculation looks to be a candidate for that.

--
You are receiving this mail because:
You are the assignee for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug bpf/22312] bpf: global variable and statistics aggregate locking

fweimer at redhat dot com
In reply to this post by fweimer at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22312
Bug 22312 depends on bug 24528, which changed state.

Bug 24528 Summary: stapbpf-next housekeeping: bpf-translate.cxx should distinguish codegen for kernel/userspace targets
https://sourceware.org/bugzilla/show_bug.cgi?id=24528

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

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