public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mel Gorman <mgorman@suse.de>
To: "Alex,Shi" <alex.shi@intel.com>
Cc: "minchan.kim@gmail.com" <minchan.kim@gmail.com>,
	"stable@kernel.org" <stable@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"andrea@cpushare.com" <andrea@cpushare.com>,
	"Chen, Tim C" <tim.c.chen@intel.com>,
	"Li, Shaohua" <shaohua.li@intel.com>
Subject: Re: [PATCH] kswapd: assign new_order and new_classzone_idx after wakeup in sleeping
Date: Thu, 28 Jul 2011 12:12:03 +0100	[thread overview]
Message-ID: <20110728111203.GM3010@suse.de> (raw)
In-Reply-To: <1311850029.27358.2408.camel@debian>

On Thu, Jul 28, 2011 at 06:47:09PM +0800, Alex,Shi wrote:
> On Thu, 2011-07-28 at 18:19 +0800, Mel Gorman wrote:
> > On Thu, Jul 28, 2011 at 04:11:28PM +0800, Alex Shi wrote:
> > > There 2 place to read pgdat in kswapd. One is return from a successful
> > > balance, another is waked up from sleeping. But the new_order and
> > > new_classzone_idx are not assigned after kswapd_try_to_sleep(), that
> > > will cause a bug in the following scenario.
> > > 
> > > After the last time successful balance, kswapd goes to sleep. So the
> > > new_order and new_classzone_idx were assigned to 0 and MAX-1 since there
> > > is no new wakeup during last time balancing. Now, a new wakeup came and
> > > finish balancing successful with order > 0. But since new_order is still
> > > 0, this time successful balancing were judged as a failed balance. so,
> > > if there is another new wakeup coming during balancing, kswapd cann't
> > > read this and still want to try to sleep. And if the new wakeup is a
> > > tighter request, kswapd may goes to sleep, not to do balancing. That is
> > > incorrect.
> > > 
> > > So, to avoid above problem, the new_order and new_classzone_idx need to
> > > be assigned for later successful comparison.
> > > 
> > 
> > Other than a different changelog, this is identical to
> > https://lkml.org/lkml/2011/6/30/157 so
> 
> Oops, I didn't aware this, otherwise it will save me several hours to
> explain what the problem in current code to Shaohua and others. :) 

Sorry for wasting your time.

> In fact, I still hold another patch of kswapd and some idea of how to
> kswapd working that want to talk with you.
> 

Post to linux-mm, cc me.

> > Acked-by: Mel Gorman <mgorman@suse.de>
> > 
> > It won't be merged to -stable until it goes to mainline though so
> > minimally you need to post this to linux-mm.
> > 
> > For -stable, you should explain why it is a candidate. I didn't push
> > the patch at the time because user problems were already resolved
> > and I wanted the merged for 3.0 before revisiting it. What problem
> > did you observe without this patch? With the lack of reference to
> > the other thread or the previous patch, I'm assuming you found and
> > solved the problem independently and I'd like to add a test case.
> 
> Actually, our LKP testing didn't find this problem on this point. Even
> with the patch, performance has no change on our machines. I just find
> this by my eyes. 
> 

Dang. I figured all right that it was unlikely the patch would
actually fix any problem but it looks correct and shouldnt' cause a
regression. You should resend the patch to Andrew cc'ing the people
in the old thread and linux-mm and ask Padraig Brady to test the
patch to confirm his problem does not reappear. When it gets into
mainline, try for -stable but I think there is very little motivation
for merging it there.

> BTW, I have tracked our benchmarks for their hot path in kernel. The
> most exercised benchmark on kswapd is no more than 5% of system load.
> that is fio mmap rand write or randrw. 
> 
> Do you have some benchmark can use kswapd much? 
> 

Not excessively. Except in cases where kswapd is buggy, I don't remember
many cases where it gets very far over 9% . I'll dig through old results
later today or tomorrow and double check.

> BTW, our project http://kernel-perf.sourceforge.net/ 

Thanks.

-- 
Mel Gorman
SUSE Labs

  reply	other threads:[~2011-07-28 11:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-28  8:11 [PATCH] kswapd: assign new_order and new_classzone_idx after wakeup in sleeping Alex Shi
2011-07-28 10:19 ` Mel Gorman
2011-07-28 10:47   ` Alex,Shi
2011-07-28 11:12     ` Mel Gorman [this message]
2011-07-29  0:10       ` Alex,Shi
  -- strict thread matches above, loose matches on Subject: below --
2011-07-29  1:34 Alex Shi
2011-07-29  8:57 ` Minchan Kim
2011-07-29 15:33   ` Shi, Alex
2011-07-29  1:45 Alex Shi

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=20110728111203.GM3010@suse.de \
    --to=mgorman@suse.de \
    --cc=alex.shi@intel.com \
    --cc=andrea@cpushare.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=minchan.kim@gmail.com \
    --cc=shaohua.li@intel.com \
    --cc=stable@kernel.org \
    --cc=tim.c.chen@intel.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