Re: [PATCH next v3] sbitmap: fix lockup while swapping

Keith Busch
2022-09-29T19:56:41Z

On Thu, Sep 29, 2022 at 12:50:12PM -0700, Hugh Dickins wrote:
> @@ -587,7 +587,7 @@ static struct sbq_wait_state *sbq_wake_p
> for (i = 0; i < SBQ_WAIT_QUEUES; i++) {
> struct sbq_wait_state *ws = &sbq->ws[wake_index];
>
> - if (waitqueue_active(&ws->wait)) {
> + if (waitqueue_active(&ws->wait) && atomic_read(&ws->wait_cnt)) {
> if (wake_index != atomic_read(&sbq->wake_index))
> atomic_set(&sbq->wake_index, wake_index);
> return ws;

This change makes sense and looks good. Thanks for the follow up.

Reviewed-by: Keith Busch <kbusch@kernel.org>