From: Kairui Song <ryncsn@gmail.com>
To: linux-mm@kvack.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
Chris Li <chrisl@kernel.org>,
Kemeng Shi <shikemeng@huaweicloud.com>,
Nhat Pham <nphamcs@gmail.com>, Baoquan He <bhe@redhat.com>,
Barry Song <baohua@kernel.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Carsten Grohmann <carstengrohmann@gmx.de>,
linux-kernel@vger.kernel.org,
"open list:SUSPEND TO RAM" <linux-pm@vger.kernel.org>
Subject: Re: [PATCH 0/2] mm/swap: hibernate: improve hibernate performance with new allocator
Date: Sun, 15 Feb 2026 19:18:31 +0800 [thread overview]
Message-ID: <CAMgjq7Dqh4xPFQe1AywHytn6zCRjTS0GBy9FTb4F-AuN66OFiw@mail.gmail.com> (raw)
In-Reply-To: <20260215-hibernate-perf-v1-0-f55ee9ee67db@tencent.com>
On Sun, Feb 15, 2026 at 6:25 PM Kairui Song <ryncsn@gmail.com> wrote:
>
> The new swap allocator didn't provide a high-performance allocation
> method for hibernate, and just left it using the easy slow path. As a
> result, hibernate performance is quite bad on some devices
>
> Fix it by implementing hibernate support for the fast allocation path.
>
> This regression seems only happen with SSD devices with poor 4k
> performance. I've tested on several different NVME and SSD setups, the
> performance diff is tiny on them, but testing on a Samsung SSD 830
> Series (SATA II, 3.0 Gbps) showed a big difference [1]:
>
> Test result with Samsung SSD 830 Series (SATA II, 3.0 Gbps) thanks
> to Carsten Grohman [1]:
> 6.19: 324 seconds
> After this series: 35 seconds
>
> Test result with SAMSUNG MZ7LH480HAHQ-00005 (SATA 3.2, 6.0 Gb/s):
> Before 0ff67f990bd4: Wrote 2230700 kbytes in 4.47 seconds (499.03 MB/s)
> After 0ff67f990bd4: Wrote 2215472 kbytes in 4.44 seconds (498.98 MB/s)
> After this series: Wrote 2038748 kbytes in 4.04 seconds (504.64 MB/s)
>
> Test result with Memblaze P5910DT0384M00:
> Before 0ff67f990bd4: Wrote 2222772 kbytes in 0.84 seconds (2646.15 MB/s)
> After 0ff67f990bd4: Wrote 2224184 kbytes in 0.90 seconds (2471.31 MB/s)
> After this series: Wrote 1559088 kbytes in 0.55 seconds (2834.70 MB/s)
>
> The performance is almost the same for blazing fast SSDs, but for some
> SSDs, the performance is several times better.
>
> Patch 1 improves the hibernate performance by using the fast path, and
> patch 2 cleans up the code a bit since there are now multiple fast path
> users using similar conventions.
>
> Signed-off-by: Kairui Song <kasong@tencent.com>
> Tested-by: Carsten Grohmann <carstengrohmann@gmx.de>
> Link: https://lore.kernel.org/linux-mm/8b4bdcfa-ce3f-4e23-839f-31367df7c18f@gmx.de/ [1]
> ---
> Kairui Song (2):
> mm, swap: speed up hibernation allocation and writeout
> mm, swap: merge common convention and simplify allocation helper
>
> mm/swapfile.c | 56 ++++++++++++++++++++++++++------------------------------
> 1 file changed, 26 insertions(+), 30 deletions(-)
> ---
> base-commit: 53f061047924205138ad9bc315885255f7cc4944
> change-id: 20260212-hibernate-perf-fb7783b2b252
>
> Best regards,
> --
> Kairui Song <kasong@tencent.com>
>
Patch 1/2 is a wrong patch, sorry about this.
Just resent the series using B4 relay and marking it as V2 to
distinguish from this misformed one, please check that series instead,
thanks!
https://lore.kernel.org/linux-mm/20260215-hibernate-perf-v2-0-cf28c75b04b7@tencent.com/
prev parent reply other threads:[~2026-02-15 11:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-15 10:25 Kairui Song
2026-02-15 10:25 ` [PATCH 2/2] mm, swap: merge common convention and simplify allocation helper Kairui Song
2026-02-15 10:38 ` [PATCH 1/2] mm, swap: simplify checking if a folio is swapped Kairui Song
2026-02-15 10:41 ` Kairui Song
2026-02-15 11:18 ` Kairui Song [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAMgjq7Dqh4xPFQe1AywHytn6zCRjTS0GBy9FTb4F-AuN66OFiw@mail.gmail.com \
--to=ryncsn@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=baohua@kernel.org \
--cc=bhe@redhat.com \
--cc=carstengrohmann@gmx.de \
--cc=chrisl@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-pm@vger.kernel.org \
--cc=nphamcs@gmail.com \
--cc=rafael@kernel.org \
--cc=shikemeng@huaweicloud.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox