]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm/swap: skip scanning cluster range if it's empty cluster
authorBaoquan He <bhe@redhat.com>
Wed, 5 Feb 2025 09:27:13 +0000 (17:27 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 28 Feb 2025 00:59:48 +0000 (16:59 -0800)
commitcbd874967d85cd449111e82bd517111e340e64f9
tree98cca59392f9fa96f197134d46e4d177872f7be7
parent50cbe614b3ab3a4e9b660fd9b470b57d18e5a27d
mm/swap: skip scanning cluster range if it's empty cluster

Since ci->lock has been taken when isolating cluster from
si->free_clusters or taking si->percpu_cluster->next[order], it's
unnecessary to scan and check the cluster range availability if i'ts empty
cluster, and this can accelerate the huge page swapping.

Link: https://lkml.kernel.org/r/20250205092721.9395-5-bhe@redhat.com
Signed-off-by: Baoquan He <bhe@redhat.com>
Cc: Chris Li <chrisl@kernel.org>
Cc: Kairui Song <ryncsn@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/swapfile.c