Re: [PATCH v3] libcxgb: use raw_cpu_ptr() in ppm_get_cpu_entries()
From: sashiko-bot
Date: Tue Nov 10 2026 - 06:00:01 EST
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] libcxgb: missing Fixes: trailer on bug-fix commit for
ppm_get_cpu_entries()
--
commit f26f870fe2fc150e7c6210fe2807b65ce57e879d
Author: Haoran Wang <haoranwangsec@xxxxxxxxx>
> libcxgb: use raw_cpu_ptr() in ppm_get_cpu_entries()
>
> ppm_get_cpu_entries() disables preemption with get_cpu(), reads the
> current CPU's pool with per_cpu_ptr(), then acquires the pool's
> spin_lock_bh() while preemption is still disabled, and finally put_cpu().
>
> On PREEMPT_RT kernels spin_lock_bh() becomes a sleeping lock
> (rt_spin_lock), so the task may sleep with preempt_count elevated:
> scheduling while atomic, reported as a BUG by CONFIG_DEBUG_ATOMIC_SLEEP
> and a deadlock once the lock is contended. Any iSCSI offload I/O
> through a Chelsio NIC that reaches ppm_get_cpu_entries() triggers it.
>
> Read the current CPU with raw_cpu_ptr() without raising preempt_count,
> and derive the global index base from pool->base (initialised when the
> pools are allocated) instead of cpu * pool_index_max, so the base
> always matches the pool that was locked. The owning CPU remains in the
> debug output, now derived from pool->base.
>
> Signed-off-by: Haoran Wang <haoranwangsec@xxxxxxxxx>
[Severity: Low]
Since this fixes a sleeping-while-atomic bug in ppm_get_cpu_entries() on
PREEMPT_RT kernels, should this include a Fixes: tag?
Fixes: 47da7e62b391 ("cxgb4: add iSCSI DDP page pod manager")
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261109180748.33682-1-haoranwangsec@xxxxxxxxx?part=1