]> git.ipfire.org Git - thirdparty/kernel/linux.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>
Mon, 17 Mar 2025 05:06:05 +0000 (22:06 -0700)
commit9b9cba7289ba7e5076fbfe913860306b4672631c
tree5416b6dde44586948366906840fbaffddc0bd727
parent0eb7d2c337f9df3b6adbcbdce213595d94781e05
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