Re: [PATCH] lib: fix compare_delta parameter order in percpu_counter_tree
From: Mathieu Desnoyers
Date: Mon Mar 16 2026 - 09:56:22 EST
On 2026-03-16 09:41, David CARLIER wrote:
Sure. For precise_compare_value, the boundary tests extend
naturally — the function must return the exact result regardless
of which code path (fast approximate or precise fallback) is taken.
For the two-counter APIs, I noticed that the combined accuracy
is always symmetric: over_a + under_b = under_a + over_b =
(bs_a + bs_b - 1) * multiplier, so the asymmetric gap test
doesn't apply there. But boundary tests at the combined accuracy
limit still provide useful coverage.
In order to do a relevant test for the two-counter APIs, we'll need
to initialize each of the two counters with different batch sizes.
This will ensure that the limits are asymmetric, and therefore allow
more precise testing of the limit conditions.
Thanks,
Mathieu
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com