Re: [PATCH 2/2] lib: add kunit boundary tests for percpu_counter_tree comparisons

From: Mathieu Desnoyers

Date: Mon Mar 16 2026 - 10:45:05 EST


On 2026-03-16 10:38, David Carlier wrote:
Add boundary tests for all four comparison APIs to validate that
the accuracy parameters are correctly applied:

- percpu_counter_tree_approximate_compare_value()
- percpu_counter_tree_precise_compare_value()
- percpu_counter_tree_approximate_compare()
- percpu_counter_tree_precise_compare()

The single-value tests probe the accuracy range boundaries (at,
beyond, and in the asymmetric gap between under and over) to catch
swapped accuracy parameters. The two-counter tests verify the
symmetric combined accuracy boundary for counter-to-counter
comparisons.

Signed-off-by: David Carlier <devnexen@xxxxxxxxx>

Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxxxx>

--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com