Message ID | 20230720094555.1397621-7-chengming.zhou@linux.dev (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | sbitmap: fix offset hint wrap and some optimizations | expand |
diff --git a/lib/sbitmap.c b/lib/sbitmap.c index 6778ab3fc6a5..38c265e4ef9d 100644 --- a/lib/sbitmap.c +++ b/lib/sbitmap.c @@ -672,6 +672,10 @@ void sbitmap_queue_wake_all(struct sbitmap_queue *sbq) * sbitmap_queue_wake_up(). */ smp_mb(); + + if (!atomic_read(&sbq->ws_active)) + return; + wake_index = READ_ONCE(sbq->wake_index); for (i = 0; i < SBQ_WAIT_QUEUES; i++) { struct sbq_wait_state *ws = &sbq->ws[wake_index];