diff options
| author | Stephen Boyd <[email protected]> | 2022-03-15 14:06:06 -0700 |
|---|---|---|
| committer | Stephen Boyd <[email protected]> | 2022-03-15 14:06:06 -0700 |
| commit | 99105cc81885e1278c927cdff15a3fdef5c29289 (patch) | |
| tree | c48ea12335dc9006df715a05433f3f19a3570ff7 /lib/sbitmap.c | |
| parent | ed06099c5d0b329082cc19c58eace0b20bf7fe70 (diff) | |
| parent | 754e0b0e35608ed5206d6a67a791563c631cec07 (diff) | |
Merge tag 'v5.17-rc4' into clk-ti
We want to get commit 31aa7056bbec ("ARM: dts: Don't use legacy clock
defines for dra7 clkctrl") so merge in the nearest rc.
Diffstat (limited to 'lib/sbitmap.c')
| -rw-r--r-- | lib/sbitmap.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/sbitmap.c b/lib/sbitmap.c index 6220fa67fb7e..09d293c30fd2 100644 --- a/lib/sbitmap.c +++ b/lib/sbitmap.c @@ -488,9 +488,13 @@ void sbitmap_queue_recalculate_wake_batch(struct sbitmap_queue *sbq, unsigned int users) { unsigned int wake_batch; + unsigned int min_batch; + unsigned int depth = (sbq->sb.depth + users - 1) / users; - wake_batch = clamp_val((sbq->sb.depth + users - 1) / - users, 4, SBQ_WAKE_BATCH); + min_batch = sbq->sb.depth >= (4 * SBQ_WAIT_QUEUES) ? 4 : 1; + + wake_batch = clamp_val(depth / SBQ_WAIT_QUEUES, + min_batch, SBQ_WAKE_BATCH); __sbitmap_queue_update_wake_batch(sbq, wake_batch); } EXPORT_SYMBOL_GPL(sbitmap_queue_recalculate_wake_batch); |