Re: [PATCH] mm/vmscan: reduce double-check if kswapd is not able to sleep

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Oct 23, 2022 at 08:04:31AM +0000, Wei Yang wrote:
>In function kswapd_try_to_sleep, there are two phases for kswapd to
>sleep:
>
>  * premature sleep
>  * fully sleep
>
>For each phase we need to check whether kswapd is fine to sleep.
>
>While if it doesn't pass the check for first phase, it is not necessary
>to do the check again.
>
>Signed-off-by: Wei Yang <richard.weiyang@xxxxxxxxx>
>CC: Mel Gorman <mgorman@xxxxxxxxxxxxxxxxxxx>
>CC: Daero Lee <skseofh@xxxxxxxxx>
>
>---
>The original thread is
>https://lkml.kernel.org/lkml/20220106094650.GX3366@xxxxxxxxxxxxxxxxxxx/T/,
>but seems no further following up.
>
>So I pick it up.
>
>Mel,
>
>I just see your mail, sorry for the late reply :-(
>---
> mm/vmscan.c | 18 ++++++++++++------
> 1 file changed, 12 insertions(+), 6 deletions(-)
>
>diff --git a/mm/vmscan.c b/mm/vmscan.c
>index 04d8b88e5216..5a50b5908c4c 100644
>--- a/mm/vmscan.c
>+++ b/mm/vmscan.c
>@@ -7179,7 +7179,8 @@ static enum zone_type kswapd_highest_zoneidx(pg_data_t *pgdat,
> static void kswapd_try_to_sleep(pg_data_t *pgdat, int alloc_order, int reclaim_order,
> 				unsigned int highest_zoneidx)
> {
>-	long remaining = 0;
>+	long remaining;

Hmm... I am afraid remaining should still be init to 0, otherwise
count_vm_event() may record a wrong event.

-- 
Wei Yang
Help you, Help me




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux