diff options
| author | Jakub Kicinski <kuba@kernel.org> | 2023-07-27 15:21:46 -0700 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2023-07-27 15:22:46 -0700 |
| commit | 014acf26685cfcfae37c9e98b83c622c0b01cf19 (patch) | |
| tree | 85ce0217698aef25875fdc62f2332bbbbc1bff2c /lib/sbitmap.c | |
| parent | Merge branch 'virtio-vsock-some-updates-for-msg_peek-flag' (diff) | |
| parent | Merge tag 'net-6.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/netd... (diff) | |
| download | linux-014acf26685cfcfae37c9e98b83c622c0b01cf19.tar.gz linux-014acf26685cfcfae37c9e98b83c622c0b01cf19.zip | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Cross-merge networking fixes after downstream PR.
No conflicts or adjacent changes.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'lib/sbitmap.c')
| -rw-r--r-- | lib/sbitmap.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/sbitmap.c b/lib/sbitmap.c index eff4e42c425a..d0a5081dfd12 100644 --- a/lib/sbitmap.c +++ b/lib/sbitmap.c @@ -550,7 +550,7 @@ EXPORT_SYMBOL_GPL(sbitmap_queue_min_shallow_depth); 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; + } } if (wake_index != atomic_read(&sbq->wake_index)) |
