Re: [PATCH -next RFC v2 8/8] sbitmap: wake up the number of threads based on required tags

From: Bart Van Assche
Date: Mon Apr 11 2022 - 23:20:45 EST


On 4/9/22 00:01, yukuai (C) wrote:
For the race that new threads are waited after get_wake_nr() and before
wake_up_nr() in situation (b), I can't figure out how this can be
problematic [ ... ]

If the atomic_dec_return() statement in __sbq_wake_up() returns a value that is less than or equal to zero, wake_batch waiters should be woken up or I/O will hang until sbitmap_queue_wake_all() is called. That last function should not be called unless there is no alternative.

Thanks,

Bart.