]> Git Repo - linux.git/blobdiff - lib/sbitmap.c
mm/readahead: Align file mappings for non-DAX
[linux.git] / lib / sbitmap.c
index 6220fa67fb7e6cd2c383efe28b4b9cced6d8e70a..09d293c30fd2d38be702b6a0fa88a35a219abfed 100644 (file)
@@ -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);
This page took 0.032741 seconds and 4 git commands to generate.