Revert "Revert "sbitmap: correct wake_batch recalculation to avoid potential IO hung""

This reverts commit f12f3bc9c7.

It was perserving the ABI, but that is not needed anymore at this point
in time.

Change-Id: Idfe61bf8ce3a83c66c31769b845572454f0f196b
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman 2023-03-16 18:38:40 +00:00 committed by Carlos Llamas
parent 02fb5b0cc5
commit d774f1e1f0

View File

@ -464,13 +464,10 @@ void sbitmap_queue_recalculate_wake_batch(struct sbitmap_queue *sbq,
unsigned int users) unsigned int users)
{ {
unsigned int wake_batch; unsigned int wake_batch;
unsigned int min_batch;
unsigned int depth = (sbq->sb.depth + users - 1) / users; unsigned int depth = (sbq->sb.depth + users - 1) / users;
min_batch = sbq->sb.depth >= (4 * SBQ_WAIT_QUEUES) ? 4 : 1;
wake_batch = clamp_val(depth / SBQ_WAIT_QUEUES, wake_batch = clamp_val(depth / SBQ_WAIT_QUEUES,
min_batch, SBQ_WAKE_BATCH); 1, SBQ_WAKE_BATCH);
WRITE_ONCE(sbq->wake_batch, wake_batch); WRITE_ONCE(sbq->wake_batch, wake_batch);
} }