Skip to content

Commit d0f4ee0

Browse files
ryncsn1Naim
authored andcommitted
mm/mglru: use a smaller batch for reclaim
With a fixed number to reclaim calculated at the beginning, making each following step smaller should reduce the lock contention and avoid over-aggressive reclaim of folios, as it will abort earlier when the number of folios to be reclaimed is reached. Reviewed-by: Axel Rasmussen <axelrasmussen@google.com> Reviewed-by: Chen Ridong <chenridong@huaweicloud.com> Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com> Signed-off-by: Kairui Song <kasong@tencent.com>
1 parent 83b6ba5 commit d0f4ee0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

mm/vmscan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4880,7 +4880,7 @@ static bool try_to_shrink_lruvec(struct lruvec *lruvec, struct scan_control *sc)
48804880
break;
48814881
}
48824882

4883-
nr_batch = min(nr_to_scan, MAX_LRU_BATCH);
4883+
nr_batch = min(nr_to_scan, MIN_LRU_BATCH);
48844884
delta = evict_folios(nr_batch, lruvec, sc, swappiness);
48854885
if (!delta)
48864886
break;

0 commit comments

Comments
 (0)