From: Wei Yang <richard.weiyang@gmail.com>
To: Wei Yang <richard.weiyang@gmail.com>
Cc: akpm@linux-foundation.org, linux-mm@kvack.org,
Mel Gorman <mgorman@techsingularity.net>,
Daero Lee <skseofh@gmail.com>
Subject: Re: [PATCH] mm/vmscan: reduce double-check if kswapd is not able to sleep
Date: Sun, 23 Oct 2022 13:11:29 +0000 [thread overview]
Message-ID: <20221023131129.jba6qq64ho45gdnn@master> (raw)
In-Reply-To: <20221023080431.30893-1-richard.weiyang@gmail.com>
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@gmail.com>
>CC: Mel Gorman <mgorman@techsingularity.net>
>CC: Daero Lee <skseofh@gmail.com>
>
>---
>The original thread is
>https://lkml.kernel.org/lkml/20220106094650.GX3366@techsingularity.net/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
next prev parent reply other threads:[~2022-10-23 13:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-23 8:04 [PATCH] mm/vmscan: reduce double-check if kswapd is not able to sleep Wei Yang
2022-10-23 13:11 ` Wei Yang [this message]
2022-10-24 7:04 ` Dan Carpenter
2022-10-24 8:32 ` Wei Yang
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=20221023131129.jba6qq64ho45gdnn@master \
--to=richard.weiyang@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=skseofh@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.