linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Kairui Song <ryncsn@gmail.com>
To: Pierre Juhen <pierre.juhen@orange.fr>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	bugzilla-daemon@kernel.org,  linux-mm@kvack.org
Subject: Re: [Bug 220605] New: Very slow access on HDD when a swap partition is used on this HDD on kernel 6.16
Date: Tue, 14 Oct 2025 14:57:03 +0800	[thread overview]
Message-ID: <CAMgjq7AvfqbCwLRHPOwS2hAuFc004rmoZiAD6mGzADEK6zwM0A@mail.gmail.com> (raw)
In-Reply-To: <CAMgjq7Ce_WXHJeV8tmbRT1wAYY2_2f8G8Z-9tbSjkjOg3077ag@mail.gmail.com>

On Tue, Oct 14, 2025 at 2:29 PM Kairui Song <ryncsn@gmail.com> wrote:
>
> On Sat, Oct 11, 2025 at 3:42 AM Pierre Juhen <pierre.juhen@orange.fr> wrote:
> >
> > Hi Andrew and people reading those lists,
>
> Hi Pierre,
>
> > $ sudo hdparm -t /dev/sda
> > /dev/sda:
> >  Timing buffered disk reads: 612 MB in  3.01 seconds = 203.56 MB/sec
> > $ sudo hdparm -t /dev/sdb
> > /dev/sdb:
> >  Timing buffered disk reads: 570 MB in  3.00 seconds = 189.95 MB/sec
> > pierre@pierre:~$
> >
> > But swap is not used
> >
> > MiB Mem :  31952,0 total,  27091,7 free,   3057,6 used,   2343,0 buff/cache
> > MiB Swap:  36000,0 total,  36000,0 free,      0,0 used.  28894,4 avail Mem
> >
>
> So the disk is already having a performance regression after swapon,
> while there is no memory pressure and SWAP is not used yet?
>
> Are you using swapon on the whole disk / partition or swapon on a file
> on top of the disk / partition?
>
> >
> > So I suspect that, when the swap is used, there is some sort of lock that slows
> > the whole disk that contains the swap partition that is being used.
> >
> > Logically, the system becomes very slow.
>
> This is really strange if swap is not actually used. I just tested
> with HDD locally and didn't find anything wrong about it.

I just checked the bugzilla page more carefully, sorry I had some
misunderstanding of what is going on just now.

So usually when there is swap IO on an HDD, it will cause performance
regression because HDDs are slow and really bad at random IO. So if
you are seeing a lower performance with recent kernels, could you help
check if that's because the memory pressure is higher, or the kernel
prefers to do SWAP more aggressively now, or the performance is
just worse when swap is working? Maybe you can check and compare the
swap usage after the same workload before / after the regression?

I'll also try to test again locally with some slight pressure on swap.


  reply	other threads:[~2025-10-14  6:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-220605-27@https.bugzilla.kernel.org/>
2025-09-29 23:07 ` Andrew Morton
2025-10-10 16:06   ` Pierre Juhen
2025-10-14  6:29     ` Kairui Song
2025-10-14  6:57       ` Kairui Song [this message]
2025-10-15 13:00   ` Pierre Juhen
2025-10-16  8:04   ` Pierre Juhen

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=CAMgjq7AvfqbCwLRHPOwS2hAuFc004rmoZiAD6mGzADEK6zwM0A@mail.gmail.com \
    --to=ryncsn@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=bugzilla-daemon@kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=pierre.juhen@orange.fr \
    /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