tests: lib: lockfree: Fix MPSC test consumer node return logic
The MPSC test consumer was incorrectly handling node returns to
producer free queues. It called spsc_acquire() without checking the
return value, then unconditionally called spsc_produce(). When the
SPSC free queue was full, spsc_acquire() would return NULL and not
increment the acquire counter, causing spsc_produce() to silently do
nothing (it only produces if acquire > 0). This resulted in lost nodes.
At least on QEMU, a 4-CPU configuration is needed for this bug to manifest.
Producers put all nodes in flight simultaneously with the single consumer
unable to keep up, causing frequent SPSC queue full conditions.
The Fix: Loop on spsc_acquire() until it succeeds before calling
spsc_produce(). This ensures nodes are always successfully returned to
producer queues.
Added board overlay for qemu_cortex_a53/smp to enable 4-CPU testing,
which reproduces the issue and validates the fix.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
3 files changed