From: Yu Zhao <yuzhao@google.com>
To: Jaroslav Pulchart <jaroslav.pulchart@gooddata.com>
Cc: linux-mm@kvack.org, akpm@linux-foundation.org
Subject: Re: high kswapd CPU usage with symmetrical swap in/out pattern with multi-gen LRU
Date: Wed, 8 Nov 2023 10:47:51 -0800 [thread overview]
Message-ID: <CAOUHufYzBfc-NtYd6XRanqPKPwyLUDBG_VYMEB4G3PsVBwLDfg@mail.gmail.com> (raw)
In-Reply-To: <CAK8fFZ4DY+GtBA40Pm7Nn5xCHy+51w3sfxPqkqpqakSXYyX+Wg@mail.gmail.com>
Hi Jaroslav,
On Wed, Nov 8, 2023 at 6:35 AM Jaroslav Pulchart
<jaroslav.pulchart@gooddata.com> wrote:
>
> Hello,
>
> I would like to report to you an unpleasant behavior of multi-gen LRU
> with strange swap in/out usage on my Dell 7525 two socket AMD 74F3
> system (16numa domains).
Kernel version please?
> Symptoms of my issue are
>
> /A/ if mult-gen LRU is enabled
> 1/ [kswapd3] is consuming 100% CPU
Just thinking out loud: kswapd3 means the fourth node was under memory pressure.
> top - 15:03:11 up 34 days, 1:51, 2 users, load average: 23.34,
> 18.26, 15.01
> Tasks: 1226 total, 2 running, 1224 sleeping, 0 stopped, 0 zombie
> %Cpu(s): 12.5 us, 4.7 sy, 0.0 ni, 82.1 id, 0.0 wa, 0.4 hi,
> 0.4 si, 0.0 st
> MiB Mem : 1047265.+total, 28382.7 free, 1021308.+used, 767.6 buff/cache
> MiB Swap: 8192.0 total, 8187.7 free, 4.2 used. 25956.7 avail Mem
> ...
> 765 root 20 0 0 0 0 R 98.3 0.0
> 34969:04 kswapd3
> ...
> 2/ swap space usage is low about ~4MB from 8GB as swap in zram (was
> observed with swap disk as well and cause IO latency issues due to
> some kind of locking)
> 3/ swap In/Out is huge and symmetrical ~12MB/s in and ~12MB/s out
>
>
> /B/ if mult-gen LRU is disabled
> 1/ [kswapd3] is consuming 3%-10% CPU
> top - 15:02:49 up 34 days, 1:51, 2 users, load average: 23.05,
> 17.77, 14.77
> Tasks: 1226 total, 1 running, 1225 sleeping, 0 stopped, 0 zombie
> %Cpu(s): 14.7 us, 2.8 sy, 0.0 ni, 81.8 id, 0.0 wa, 0.4 hi,
> 0.4 si, 0.0 st
> MiB Mem : 1047265.+total, 28378.5 free, 1021313.+used, 767.3 buff/cache
> MiB Swap: 8192.0 total, 8189.0 free, 3.0 used. 25952.4 avail Mem
> ...
> 765 root 20 0 0 0 0 S 3.6 0.0
> 34966:46 [kswapd3]
> ...
> 2/ swap space usage is low (4MB)
> 3/ swap In/Out is huge and symmetrical ~500kB/s in and ~500kB/s out
>
> Both situations are wrong as they are using swap in/out extensively,
> however the multi-gen LRU situation is 10times worse.
From the stats below, node 3 had the lowest free memory. So I think in
both cases, the reclaim activities were as expected.
> Could I ask for any suggestions on how to avoid the kswapd utilization
> pattern?
The easiest way is to disable NUMA domain so that there would be only
two nodes with 8x more memory. IOW, you have fewer pools but each pool
has more memory and therefore they are less likely to become empty.
> There is a free RAM in each numa node for the few MB used in
> swap:
> NUMA stats:
> NUMA nodes: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
> MemTotal: 65048 65486 65486 65486 65486 65486 65486 65469 65486
> 65486 65486 65486 65486 65486 65486 65424
> MemFree: 468 601 1200 302 548 1879 2321 2478 1967 2239 1453 2417
> 2623 2833 2530 2269
> the in/out usage does not make sense for me nor the CPU utilization by
> multi-gen LRU.
My questions:
1. Were there any OOM kills with either case?
2. Was THP enabled?
MGLRU might have spent the extra CPU cycles just to void OOM kills or
produce more THPs.
If disabling the NUMA domain isn't an option, I'd recommend:
1. Try the latest kernel (6.6.1) if you haven't.
2. Disable THP if it was enabled, to verify whether it has an impact.
Thanks.
next prev parent reply other threads:[~2023-11-08 18:48 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-08 14:35 Jaroslav Pulchart
2023-11-08 18:47 ` Yu Zhao [this message]
2023-11-08 20:04 ` Jaroslav Pulchart
2023-11-08 22:09 ` Yu Zhao
2023-11-09 6:39 ` Jaroslav Pulchart
2023-11-09 6:48 ` Yu Zhao
2023-11-09 10:58 ` Jaroslav Pulchart
2023-11-10 1:31 ` Yu Zhao
[not found] ` <CAK8fFZ5xUe=JMOxUWgQ-0aqWMXuZYF2EtPOoZQqr89sjrL+zTw@mail.gmail.com>
2023-11-13 20:09 ` Yu Zhao
2023-11-14 7:29 ` Jaroslav Pulchart
2023-11-14 7:47 ` Yu Zhao
2023-11-20 8:41 ` Jaroslav Pulchart
2023-11-22 6:13 ` Yu Zhao
2023-11-22 7:12 ` Jaroslav Pulchart
2023-11-22 7:30 ` Jaroslav Pulchart
2023-11-22 14:18 ` Yu Zhao
2023-11-29 13:54 ` Jaroslav Pulchart
2023-12-01 23:52 ` Yu Zhao
2023-12-07 8:46 ` Charan Teja Kalla
2023-12-07 18:23 ` Yu Zhao
2023-12-08 8:03 ` Jaroslav Pulchart
2024-01-03 21:30 ` Jaroslav Pulchart
2024-01-04 3:03 ` Yu Zhao
2024-01-04 9:46 ` Jaroslav Pulchart
2024-01-04 14:34 ` Jaroslav Pulchart
2024-01-04 23:51 ` Igor Raits
2024-01-05 17:35 ` Ertman, David M
2024-01-08 17:53 ` Jaroslav Pulchart
2024-01-16 4:58 ` Yu Zhao
2024-01-16 17:34 ` Jaroslav Pulchart
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=CAOUHufYzBfc-NtYd6XRanqPKPwyLUDBG_VYMEB4G3PsVBwLDfg@mail.gmail.com \
--to=yuzhao@google.com \
--cc=akpm@linux-foundation.org \
--cc=jaroslav.pulchart@gooddata.com \
--cc=linux-mm@kvack.org \
/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