-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement a 'aggs' per-CPU BPF map to store aggregation data
Aggregation data consists of data items (all uint64_t) that are updated when an aggregation function is executed. This is quite different from other data recording actions that append data to an output buffer. We need support for concurrency control to allow reading the data during non-atomic updates. We use a latch mechanism, i.e. a multiversion concurrency control mechanism, to satify these requirements. Simply put, the per-CPU aggregation data area stores a sequence id that tracks the generation of the data updates. Since only one aggregation can be updated at a time on a single CPU, one latch is sufficient for all aggregations (per CPU-buffer). We also allocate two copies of each aggregation, which we will call A and B. When we update the aggregation data, we first modify A and then we modify B, while ensuring that while we modify one, the reader is directed to read from the other. Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com> Reviewed-by: Eugene Loh <eugene.loh@oracle.com>
- Loading branch information
Showing
4 changed files
with
43 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
Base: 0 | ||
dctx: -32 | ||
%r0: -40 | ||
%r1: -48 | ||
%r2: -56 | ||
%r3: -64 | ||
%r4: -72 | ||
%r5: -80 | ||
%r6: -88 | ||
%r7: -96 | ||
%r8: -104 | ||
lvar[ -1]: -111 (ID -1) | ||
lvar[ 0]: -112 (ID 0) | ||
lvar[ 1]: -120 (ID 1) | ||
lvar[ 18]: -256 (ID 18) | ||
dctx: -40 | ||
%r0: -48 | ||
%r1: -56 | ||
%r2: -64 | ||
%r3: -72 | ||
%r4: -80 | ||
%r5: -88 | ||
%r6: -96 | ||
%r7: -104 | ||
%r8: -112 | ||
lvar[ -1]: -119 (ID -1) | ||
lvar[ 0]: -120 (ID 0) | ||
lvar[ 1]: -128 (ID 1) | ||
lvar[ 17]: -256 (ID 17) | ||
lvar[ -1]: -257 (ID -1) | ||
scratch: -257 .. -512 |