From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
To: Minchan Kim <minchan.kim@gmail.com>
Cc: kosaki.motohiro@jp.fujitsu.com,
Larry Woodman <lwoodman@redhat.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [Patch] Call cond_resched() at bottom of main look in balance_pgdat()
Date: Tue, 22 Jun 2010 11:24:24 +0900 (JST) [thread overview]
Message-ID: <20100622112416.B554.A69D9226@jp.fujitsu.com> (raw)
In-Reply-To: <20100621141315.GB2456@barrios-desktop>
> > =============================================================
> > Subject: [PATCH] Call cond_resched() at bottom of main look in balance_pgdat()
> > From: Larry Woodman <lwoodman@redhat.com>
> >
> > We are seeing a problem where kswapd gets stuck and hogs the CPU on a
> > small single CPU system when an OOM kill should occur. When this
> > happens swap space has been exhausted and the pagecache has been shrunk
> > to zero. Once kswapd gets the CPU it never gives it up because at least
> > one zone is below high. Adding a single cond_resched() at the end of
> > the main loop in balance_pgdat() fixes the problem by allowing the
> > watchdog and tasks to run and eventually do an OOM kill which frees up
> > the resources.
> >
> > kosaki note: This seems regression caused by commit bb3ab59683
> > (vmscan: stop kswapd waiting on congestion when the min watermark is
> > not being met)
> >
> > Signed-off-by: Larry Woodman <lwoodman@redhat.com>
> > Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> > ---
> > mm/vmscan.c | 1 +
> > 1 files changed, 1 insertions(+), 0 deletions(-)
> >
> > diff --git a/mm/vmscan.c b/mm/vmscan.c
> > index 9c7e57c..c5c46b7 100644
> > --- a/mm/vmscan.c
> > +++ b/mm/vmscan.c
> > @@ -2182,6 +2182,7 @@ loop_again:
> > */
> > if (sc.nr_reclaimed >= SWAP_CLUSTER_MAX)
> > break;
> > + cond_resched();
> > }
> > out:
> > /*
> > --
> > 1.6.5.2
>
> Kosaki's patch's goal is that kswap doesn't yield cpu if the zone doesn't meet its
> min watermark to avoid failing atomic allocation.
> But this patch could yield kswapd's time slice at any time.
> Doesn't the patch break your goal in bb3ab59683?
No. it don't break.
Typically, kswapd periodically call shrink_page_list() and it call
cond_resched() even if bb3ab59683 case.
Larry observed very exceptional situation. his system don't have
reclaimable pages at all, then eventually shrink_page_list() was not
called very long time.
His patch only change such very rare situation, I think it's safe.
Thanks.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2010-06-22 2:24 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-17 18:48 Larry Woodman
2010-06-21 11:45 ` KOSAKI Motohiro
2010-06-21 14:13 ` Minchan Kim
2010-06-22 2:24 ` KOSAKI Motohiro [this message]
2010-06-22 2:45 ` Minchan Kim
2010-06-22 3:23 ` KOSAKI Motohiro
2010-06-22 4:29 ` Minchan Kim
2010-06-22 21:33 ` Johannes Weiner
2010-06-22 23:07 ` Minchan Kim
2010-06-28 19:10 ` Andrew Morton
2010-06-22 18:21 ` Rik van Riel
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=20100622112416.B554.A69D9226@jp.fujitsu.com \
--to=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lwoodman@redhat.com \
--cc=minchan.kim@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox