Re: [PATCH] mm: throttle and inc min_seq when both page types reach MIN_NR_GENS

From: Andrew Morton
Date: Wed Oct 09 2024 - 16:53:13 EST


On Wed, 9 Oct 2024 15:49:53 +0800 "zhaoyang.huang" <zhaoyang.huang@xxxxxxxxxx> wrote:

> From: Zhaoyang Huang <zhaoyang.huang@xxxxxxxxxx>
>
> The test case of [1] leads to system hang which caused by a local
> watchdog thread starved over 20s on a 5.5GB RAM ANDROID15(v6.6)
> system. This commit solve the issue by have the reclaimer be throttled
> and increase min_seq if both page types reach MIN_NR_GENS, which may
> introduce a livelock of switching type with holding lruvec->lru_lock.
>
> [1]
> launch below script 8 times simutanously which allocates 1GB virtual
> memory and access it from user space by each thread.
> $ costmem -c1024000 -b12800 -o0 &
>

That looks like a pretty simple testcase. Do people know where to get
`costmem' from?

> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c

This is a somewhat serious issue, so I'll add the patch for some
testing, but I'll await feedback from MGLRU developers before
proceeeding further, thanks.