On Fri, Jul 21, 2023 at 05:57:15PM +0800, Ming Lei wrote: > static void __sbitmap_queue_wake_up(struct sbitmap_queue *sbq, int nr) > { > - int i, wake_index; > + int i, wake_index, woken; > > if (!atomic_read(&sbq->ws_active)) > return; > @@ -567,13 +567,12 @@ static void __sbitmap_queue_wake_up(struct sbitmap_queue *sbq, int nr) > */ > wake_index = sbq_index_inc(wake_index); > > - /* > - * It is sufficient to wake up at least one waiter to > - * guarantee forward progress. > - */ > - if (waitqueue_active(&ws->wait) && > - wake_up_nr(&ws->wait, nr)) > - break; > + if (waitqueue_active(&ws->wait)) { > + woken = wake_up_nr(&ws->wait, nr); > + if (woken == nr) > + break; > + nr -= woken; > + } > } This looks good. I had something similiar at one point, but after all the churn this file had gone through, I somehow convinced myself it wasn't necessary anymore. Your analysis and fix look correct to me! Reviewed-by: Keith Busch <kbusch@xxxxxxxxxx>