Message ID | 20230324175656.85082-6-snitzer@kernel.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | dm bufio, thin: improve concurrent IO performance | expand |
diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c index 929685011e02..b638ddd161b4 100644 --- a/drivers/md/dm-bufio.c +++ b/drivers/md/dm-bufio.c @@ -1669,7 +1669,12 @@ static void __free_buffer_wake(struct dm_buffer *b) c->need_reserved_buffers--; } - wake_up(&c->free_buffer_wait); + /* + * We hold the bufio lock here, so no one can add entries to the + * wait queue anyway. + */ + if (unlikely(waitqueue_active(&c->free_buffer_wait))) + wake_up(&c->free_buffer_wait); } static enum evict_result cleaned(struct dm_buffer *b, void *context)