From: Dave Chinner <david@fromorbit.com>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: riel@redhat.com, linux-kernel@vger.kernel.org, xfs@oss.sgi.com,
hch@infradead.org, kosaki.motohiro@jp.fujitsu.com,
rientjes@google.com, Motohiro.Kosaki@us.fujitsu.com,
fengguang.wu@intel.com, akpm@linux-foundation.org,
kamezawa.hiroyu@jp.fujitsu.com
Subject: Re: [PATCH] mm/vmscan: Do not block forever at shrink_inactive_list().
Date: Thu, 5 Jun 2014 23:17:53 +1000 [thread overview]
Message-ID: <20140605131753.GD4523@dastard> (raw)
In-Reply-To: <201406052145.CIB35534.OQLVMSJFOHtFOF@I-love.SAKURA.ne.jp>
On Thu, Jun 05, 2014 at 09:45:26PM +0900, Tetsuo Handa wrote:
> David Rientjes wrote:
> > On Mon, 26 May 2014, Tetsuo Handa wrote:
> >
> > > In shrink_inactive_list(), we do not insert delay at
> > >
> > > if (!sc->hibernation_mode && !current_is_kswapd())
> > > wait_iff_congested(zone, BLK_RW_ASYNC, HZ/10);
> > >
> > > if sc->hibernation_mode != 0.
> > > Follow the same reason, we should not insert delay at
> > >
> > > while (unlikely(too_many_isolated(zone, file, sc))) {
> > > congestion_wait(BLK_RW_ASYNC, HZ/10);
> > >
> > > /* We are about to die and free our memory. Return now. */
> > > if (fatal_signal_pending(current))
> > > return SWAP_CLUSTER_MAX;
> > > }
> > >
> > > if sc->hibernation_mode != 0.
> > >
> > > Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
> > > ---
> > > mm/vmscan.c | 3 +++
> > > 1 files changed, 3 insertions(+), 0 deletions(-)
> > >
> > > diff --git a/mm/vmscan.c b/mm/vmscan.c
> > > index 32c661d..89c42ca 100644
> > > --- a/mm/vmscan.c
> > > +++ b/mm/vmscan.c
> > > @@ -1362,6 +1362,9 @@ static int too_many_isolated(struct zone *zone, int file,
> > > if (current_is_kswapd())
> > > return 0;
> > >
> > > + if (sc->hibernation_mode)
> > > + return 0;
> > > +
> > > if (!global_reclaim(sc))
> > > return 0;
> > >
> >
> > This isn't the only too_many_isolated() functions that do a delay, how is
> > the too_many_isolated() in mm/compaction.c different?
> >
>
> I don't know. But today I realized that this patch is not sufficient.
>
> I'm trying to find why __alloc_pages_slowpath() cannot return for many minutes
> when a certain type of memory pressure is given on a RHEL7 environment with
> 4 CPU / 2GB RAM. Today I tried to use ftrace for examining the breakdown of
> time-consuming functions inside __alloc_pages_slowpath(). But on the first run,
> all processes are trapped into this too_many_isolated()/congestion_wait() loop
> while kswapd is not running; stalling forever because nobody can perform
> operations for making too_many_isolated() to return 0.
>
> This means that, under rare circumstances, it is possible that all processes
> other than kswapd are trapped into too_many_isolated()/congestion_wait() loop
> while kswapd is sleeping because this loop assumes that somebody else shall
> wake up kswapd and kswapd shall perform operations for making
> too_many_isolated() to return 0. However, we cannot guarantee that kswapd is
> waken by somebody nor kswapd is not blocked by blocking operations inside
> shrinker functions (e.g. mutex_lock()).
So what you are saying is that kswapd is having problems with
getting blocked on locks held by processes in direct reclaim?
What are the stack traces that demonstrate such a dependency loop?
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
WARNING: multiple messages have this Message-ID (diff)
From: Dave Chinner <david@fromorbit.com>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: rientjes@google.com, Motohiro.Kosaki@us.fujitsu.com,
riel@redhat.com, kosaki.motohiro@jp.fujitsu.com,
fengguang.wu@intel.com, kamezawa.hiroyu@jp.fujitsu.com,
akpm@linux-foundation.org, hch@infradead.org,
linux-kernel@vger.kernel.org, xfs@oss.sgi.com
Subject: Re: [PATCH] mm/vmscan: Do not block forever at shrink_inactive_list().
Date: Thu, 5 Jun 2014 23:17:53 +1000 [thread overview]
Message-ID: <20140605131753.GD4523@dastard> (raw)
In-Reply-To: <201406052145.CIB35534.OQLVMSJFOHtFOF@I-love.SAKURA.ne.jp>
On Thu, Jun 05, 2014 at 09:45:26PM +0900, Tetsuo Handa wrote:
> David Rientjes wrote:
> > On Mon, 26 May 2014, Tetsuo Handa wrote:
> >
> > > In shrink_inactive_list(), we do not insert delay at
> > >
> > > if (!sc->hibernation_mode && !current_is_kswapd())
> > > wait_iff_congested(zone, BLK_RW_ASYNC, HZ/10);
> > >
> > > if sc->hibernation_mode != 0.
> > > Follow the same reason, we should not insert delay at
> > >
> > > while (unlikely(too_many_isolated(zone, file, sc))) {
> > > congestion_wait(BLK_RW_ASYNC, HZ/10);
> > >
> > > /* We are about to die and free our memory. Return now. */
> > > if (fatal_signal_pending(current))
> > > return SWAP_CLUSTER_MAX;
> > > }
> > >
> > > if sc->hibernation_mode != 0.
> > >
> > > Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
> > > ---
> > > mm/vmscan.c | 3 +++
> > > 1 files changed, 3 insertions(+), 0 deletions(-)
> > >
> > > diff --git a/mm/vmscan.c b/mm/vmscan.c
> > > index 32c661d..89c42ca 100644
> > > --- a/mm/vmscan.c
> > > +++ b/mm/vmscan.c
> > > @@ -1362,6 +1362,9 @@ static int too_many_isolated(struct zone *zone, int file,
> > > if (current_is_kswapd())
> > > return 0;
> > >
> > > + if (sc->hibernation_mode)
> > > + return 0;
> > > +
> > > if (!global_reclaim(sc))
> > > return 0;
> > >
> >
> > This isn't the only too_many_isolated() functions that do a delay, how is
> > the too_many_isolated() in mm/compaction.c different?
> >
>
> I don't know. But today I realized that this patch is not sufficient.
>
> I'm trying to find why __alloc_pages_slowpath() cannot return for many minutes
> when a certain type of memory pressure is given on a RHEL7 environment with
> 4 CPU / 2GB RAM. Today I tried to use ftrace for examining the breakdown of
> time-consuming functions inside __alloc_pages_slowpath(). But on the first run,
> all processes are trapped into this too_many_isolated()/congestion_wait() loop
> while kswapd is not running; stalling forever because nobody can perform
> operations for making too_many_isolated() to return 0.
>
> This means that, under rare circumstances, it is possible that all processes
> other than kswapd are trapped into too_many_isolated()/congestion_wait() loop
> while kswapd is sleeping because this loop assumes that somebody else shall
> wake up kswapd and kswapd shall perform operations for making
> too_many_isolated() to return 0. However, we cannot guarantee that kswapd is
> waken by somebody nor kswapd is not blocked by blocking operations inside
> shrinker functions (e.g. mutex_lock()).
So what you are saying is that kswapd is having problems with
getting blocked on locks held by processes in direct reclaim?
What are the stack traces that demonstrate such a dependency loop?
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2014-06-05 13:18 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-19 14:40 [PATCH] mm/vmscan: Do not block forever at shrink_inactive_list() Tetsuo Handa
2014-05-19 17:42 ` Rik van Riel
2014-05-20 0:44 ` Dave Chinner
2014-05-20 0:44 ` Dave Chinner
2014-05-20 3:54 ` Tetsuo Handa
2014-05-20 3:54 ` Tetsuo Handa
2014-05-20 5:24 ` Dave Chinner
2014-05-20 5:24 ` Dave Chinner
2014-05-20 5:59 ` Andrew Morton
2014-05-20 5:59 ` Andrew Morton
2014-05-20 6:03 ` Andrew Morton
2014-05-20 6:03 ` Andrew Morton
2014-05-20 6:33 ` Dave Chinner
2014-05-20 6:33 ` Dave Chinner
2014-05-20 6:30 ` Dave Chinner
2014-05-20 6:30 ` Dave Chinner
2014-05-20 14:58 ` Tetsuo Handa
2014-05-20 14:58 ` Tetsuo Handa
2014-05-20 16:12 ` Motohiro Kosaki
2014-05-20 16:12 ` Motohiro Kosaki
2014-05-26 11:45 ` [PATCH] mm/vmscan: Do not block forever atshrink_inactive_list() Tetsuo Handa
2014-05-26 11:45 ` Tetsuo Handa
2014-06-03 21:43 ` David Rientjes
2014-06-03 21:43 ` David Rientjes
2014-06-05 12:45 ` [PATCH] mm/vmscan: Do not block forever at shrink_inactive_list() Tetsuo Handa
2014-06-05 12:45 ` Tetsuo Handa
2014-06-05 13:17 ` Dave Chinner [this message]
2014-06-05 13:17 ` Dave Chinner
2014-06-06 12:19 ` [PATCH] mm/vmscan: Do not block forever atshrink_inactive_list() Tetsuo Handa
2014-06-06 12:19 ` Tetsuo Handa
2014-06-09 11:53 ` [PATCH] mm/vmscan: Do not block forever at shrink_inactive_list() Tetsuo Handa
2014-06-09 11:53 ` Tetsuo Handa
2014-07-02 12:40 ` Tetsuo Handa
2014-05-20 7:20 ` Christoph Hellwig
2014-05-20 7:20 ` Christoph Hellwig
2014-05-20 2:35 ` Jianyu Zhan
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=20140605131753.GD4523@dastard \
--to=david@fromorbit.com \
--cc=Motohiro.Kosaki@us.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=fengguang.wu@intel.com \
--cc=hch@infradead.org \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=penguin-kernel@I-love.SAKURA.ne.jp \
--cc=riel@redhat.com \
--cc=rientjes@google.com \
--cc=xfs@oss.sgi.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.