public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug bpf/23476] New: bpf statistical aggregates
@ 2018-08-01 18:50 me at serhei dot io
  2018-10-24 21:19 ` [Bug bpf/23476] " me at serhei dot io
  2019-06-26 19:43 ` me at serhei dot io
  0 siblings, 2 replies; 3+ messages in thread
From: me at serhei dot io @ 2018-08-01 18:50 UTC (permalink / raw)
  To: systemtap

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

            Bug ID: 23476
           Summary: bpf statistical aggregates
           Product: systemtap
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: bpf
          Assignee: systemtap at sourceware dot org
          Reporter: me at serhei dot io
  Target Milestone: ---

From the 'language features' brainstorm:

# Statistical aggregates

These can be implemented with BPF_MAP_TYPE_PERCPU storing elements of type
struct stat_data. Multiple aggregates can be stored in the same array, one per
aggregate.

Then __stp_stat_add can be implemented in kernel-space as non-looping,
non-locking eBPF code, while all other functions (reading stat value, histogram
printing) can be implemented as userspace helpers that aggregate data from all
CPUs.

As far as I can tell, it is not strictly necessary to lock a statistical
aggregate when reading its value -- the kernel-module backend does this to
guarantee a time-consistent snapshot of the different CPU's values, whereas
without locking the result might be approximate.

# {TODO} More complex structures: arrays of statistical aggregates

Still investigating whether we can do this.

(0) There is no per-CPU version of BPF_HASH.

(1) A BPF_MAP_TYPE_PERCPU would be a contiguously indexed, preallocated array
of aggregates, so a BPF_MAP_TYPE_HASH would be needed to map from sparse keys
to indices into the BPF_MAP_TYPE_PERCPU. However, without synchronization,
there is no way to allocate slots in the BPF_MAP_TYPE_PERCPU.

(2) /usr/include/linux/bpf.h mentions BPF_MAP_TYPE_HASH_OF_MAPS, but it's
currently undocumented. Still need to read the code and investigate if it works
for our purposes.

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug bpf/23476] bpf statistical aggregates
  2018-08-01 18:50 [Bug bpf/23476] New: bpf statistical aggregates me at serhei dot io
@ 2018-10-24 21:19 ` me at serhei dot io
  2019-06-26 19:43 ` me at serhei dot io
  1 sibling, 0 replies; 3+ messages in thread
From: me at serhei dot io @ 2018-10-24 21:19 UTC (permalink / raw)
  To: systemtap

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

Serhei Makarov <me at serhei dot io> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|systemtap at sourceware dot org    |me at serhei dot io

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug bpf/23476] bpf statistical aggregates
  2018-08-01 18:50 [Bug bpf/23476] New: bpf statistical aggregates me at serhei dot io
  2018-10-24 21:19 ` [Bug bpf/23476] " me at serhei dot io
@ 2019-06-26 19:43 ` me at serhei dot io
  1 sibling, 0 replies; 3+ messages in thread
From: me at serhei dot io @ 2019-06-26 19:43 UTC (permalink / raw)
  To: systemtap

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

Serhei Makarov <me at serhei dot io> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |systemtap at sourceware dot org

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-06-26 19:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-01 18:50 [Bug bpf/23476] New: bpf statistical aggregates me at serhei dot io
2018-10-24 21:19 ` [Bug bpf/23476] " me at serhei dot io
2019-06-26 19:43 ` me at serhei dot io

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).