linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Mel Gorman <mel@csn.ul.ie>
To: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	linux-mm <linux-mm@kvack.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH v3] factor out kswapd sleeping logic from kswapd()
Date: Thu, 18 Nov 2010 17:27:39 +0000	[thread overview]
Message-ID: <20101118172738.GN8135@csn.ul.ie> (raw)
In-Reply-To: <20101116144709.BF26.A69D9226@jp.fujitsu.com>

On Tue, Nov 16, 2010 at 03:07:22PM +0900, KOSAKI Motohiro wrote:
> > > +void kswapd_try_to_sleep(pg_data_t *pgdat, int order)
> > > +{
> > 
> > As pointed out elsewhere, this should be static.
> 
> Fixed.
> 
> 
> > > +	long remaining = 0;
> > > +	DEFINE_WAIT(wait);
> > > +
> > > +	if (freezing(current) || kthread_should_stop())
> > > +		return;
> > > +
> > > +	prepare_to_wait(&pgdat->kswapd_wait, &wait, TASK_INTERRUPTIBLE);
> > > +
> > > +	/* Try to sleep for a short interval */
> > > +	if (!sleeping_prematurely(pgdat, order, remaining)) {
> > > +		remaining = schedule_timeout(HZ/10);
> > > +		finish_wait(&pgdat->kswapd_wait, &wait);
> > > +		prepare_to_wait(&pgdat->kswapd_wait, &wait, TASK_INTERRUPTIBLE);
> > > +	}
> > > +
> > > +	/*
> > > +	 * After a short sleep, check if it was a
> > > +	 * premature sleep. If not, then go fully
> > > +	 * to sleep until explicitly woken up
> > > +	 */
> > 
> > Very minor but that comment should now fit on fewer lines.
> 
> Thanks, fixed.
> 
> 
> > > +	if (!sleeping_prematurely(pgdat, order, remaining)) {
> > > +		trace_mm_vmscan_kswapd_sleep(pgdat->node_id);
> > > +		set_pgdat_percpu_threshold(pgdat, calculate_normal_threshold);
> > > +		schedule();
> > > +		set_pgdat_percpu_threshold(pgdat, calculate_pressure_threshold);
> > 
> > I posted a patch adding a comment on why set_pgdat_percpu_threshold() is
> > called. I do not believe it has been picked up by Andrew but it if is,
> > the patches will conflict. The resolution will be obvious but you may
> > need to respin this patch if the comment patch gets picked up in mmotm.
> > 
> > Otherwise, I see no problems.
> 
> OK, I've rebased the patch on top your comment patch. 
> 
> 
> 
> From 1bd232713d55f033676f80cc7451ff83d4483884 Mon Sep 17 00:00:00 2001
> From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> Date: Mon, 6 Dec 2010 20:44:27 +0900
> Subject: [PATCH] factor out kswapd sleeping logic from kswapd()
> 
> Currently, kswapd() function has deeper nest and it slightly harder to
> read. cleanup it.
> 
> Cc: Mel Gorman <mel@csn.ul.ie>
> Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>

Acked-by: Mel Gorman <mel@csn.ul.ie>

-- 
Mel Gorman
Part-time Phd Student                          Linux Technology Center
University of Limerick                         IBM Dublin Software Lab

--
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/ .
Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2010-11-18 17:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-14  9:05 [PATCH] cleanup kswapd() KOSAKI Motohiro
2010-11-14 11:03 ` Jesper Juhl
2010-11-15  0:27   ` KOSAKI Motohiro
2010-11-15  1:37     ` KOSAKI Motohiro
2010-11-15  9:42 ` Mel Gorman
2010-11-16  6:07   ` [PATCH v3] factor out kswapd sleeping logic from kswapd() KOSAKI Motohiro
2010-11-18 17:27     ` Mel Gorman [this message]

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=20101118172738.GN8135@csn.ul.ie \
    --to=mel@csn.ul.ie \
    --cc=akpm@linux-foundation.org \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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