Re: [PATCH] lib: skip percpu_counter_tree boundary kunit tests on single-CPU
From: Mark Brown
Date: Tue Mar 17 2026 - 11:55:03 EST
On Tue, Mar 17, 2026 at 03:39:15PM +0000, David Carlier wrote:
> On single-CPU topologies, accuracy_multiplier is zero, making both
> approx_accuracy_range.under and .over zero. The boundary tests in
> hpcc_test_compare_value_boundaries and hpcc_test_compare_counter_boundaries
> then degenerate to comparing 0 vs 0, which correctly returns 0 (equal)
> but the tests expect nonzero results.
>
> Skip these boundary tests with kunit_skip() when accuracy is zero,
> since approximation boundaries are meaningless without multi-CPU carry
> propagation. Use percpu_counter_tree_items_size() as the topology check
> before any allocations to avoid leaking memory on skip.
Reviewed-by: Mark Brown <broonie@xxxxxxxxxx>
Thanks!
Attachment:
signature.asc
Description: PGP signature