Re: [PATCH v2 1/2] mm, swap: speed up hibernation allocation and writeout
From: Andrew Morton
Date: Sun Feb 15 2026 - 12:02:47 EST
On Sun, 15 Feb 2026 19:15:05 +0800 Kairui Song via B4 Relay <devnull+kasong.tencent.com@xxxxxxxxxx> wrote:
> Since commit 0ff67f990bd4 ("mm, swap: remove swap slot cache"),
> hibernation has been using the swap slot slow allocation path for
> simplification, which turns out might cause regression for some
> devices because the allocator now rotates clusters too often, leading to
> slower allocation and more random distribution of data.
>
> Fast allocation is not complex, so implement hibernation support as
> well.
>
> And reduce the indent of the code too, while at it. It doesn't have to
> check the device flag, as the allocator will also check the device flag
> and refuse to allocate if the device is not writable.
>
> Test result with Samsung SSD 830 Series (SATA II, 3.0 Gbps) shows the
> performance is several times better [1]:
> 6.19: 324 seconds
> After this series: 35 seconds
10x is a lot, so I think we should offer this to -stable kernels.
If you agree, could you please prepare a more backportable fix?
Something minimal, separated from the [2/2] cleanup and without the
incidental whitespace alteration?
We can look at the indenting alteration and [2/2] after 7.0-rc1.