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 | |
parent | 9d0cd5d25f7d45bce01bbb3193b54ac24b3a60f3 (diff) | |
parent | 57012c57536f8814dec92e74197ee96c3498d24e (diff) |
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')
-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)) |