Tests: Test snapshot maximum size correctly
authorOlivier Dion <odion@efficios.com>
Wed, 1 Feb 2023 22:11:02 +0000 (17:11 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 13 Feb 2023 21:21:26 +0000 (16:21 -0500)
The minimum size for a channel is determined by:

  sub-buffer-size * sub-buffer-count * possible-cpus

where sub-buffer-size is the system page size and sub-buffer-count is 2.

We set a snapshot with a maximum size of the minimum size. From there,
we need to spam that amount of events, assuming each event to be one
byte, on every online CPUs. We can then ensure that the total snapshot's
size is equal to the minimum size for a channel. However, there's a
little bias if the number of possible cores is greater than the number
of online cores. In that case, the bias is one sub-buffer for each extra
ring buffer.

Change-Id: I4718e134684463789b4f7be9b12c9bf3d6cfec20
Signed-off-by: Olivier Dion <odion@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>

No differences found
This page took 0.024484 seconds and 4 git commands to generate.