public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mel Gorman <mel@csn.ul.ie>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: David Rientjes <rientjes@google.com>,
	linux-kernel@vger.kernel.org, hughd@google.com
Subject: Re: + mm-vmscan-reclaim-order-0-and-use-compaction-instead-of-lumpy-reclai m-avoid-a-potential-deadlock-due-to-lock_page-during-direct-compacti on-fix.patch added to -mm tree
Date: Wed, 12 Jan 2011 09:28:12 +0000	[thread overview]
Message-ID: <20110112092812.GH11932@csn.ul.ie> (raw)
In-Reply-To: <20110111135547.ce6c273c.akpm@linux-foundation.org>

On Tue, Jan 11, 2011 at 01:55:47PM -0800, Andrew Morton wrote:
> On Tue, 11 Jan 2011 13:43:06 -0800 (PST)
> David Rientjes <rientjes@google.com> wrote:
> 
> > On Tue, 11 Jan 2011, akpm@linux-foundation.org wrote:
> > 
> > > diff -puN mm/page_alloc.c~mm-vmscan-reclaim-order-0-and-use-compaction-instead-of-lumpy-reclaim-avoid-a-potential-deadlock-due-to-lock_page-during-direct-compaction-fix mm/page_alloc.c
> > > --- a/mm/page_alloc.c~mm-vmscan-reclaim-order-0-and-use-compaction-instead-of-lumpy-reclaim-avoid-a-potential-deadlock-due-to-lock_page-during-direct-compaction-fix
> > > +++ a/mm/page_alloc.c
> > > @@ -1815,15 +1815,15 @@ __alloc_pages_direct_compact(gfp_t gfp_m
> > >  	int migratetype, unsigned long *did_some_progress)
> > >  {
> > >  	struct page *page;
> > > -	struct task_struct *p = current;
> > > +	struct task_struct *tsk = current;
> > >  
> > >  	if (!order || compaction_deferred(preferred_zone))
> > >  		return NULL;
> > >  
> > > -	p->flags |= PF_MEMALLOC;
> > > +	tsk->flags |= PF_MEMALLOC;
> > >  	*did_some_progress = try_to_compact_pages(zonelist, order, gfp_mask,
> > >  								nodemask);
> > > -	p->flags &= ~PF_MEMALLOC;
> > > +	tsk->flags &= ~PF_MEMALLOC;
> > >  	if (*did_some_progress != COMPACT_SKIPPED) {
> > >  
> > >  		/* Page migration frees to the PCP lists but we want merging */
> > 
> > This could be done for all of the page allocator functions in 
> > mm/page_alloc.c, I think it would be inconsistent and slightly harder to 
> > read if it were done in only one.
> 
> Using "p" for any identifier which has less-than-teeny scope is plain
> dumb.  It's meaningless and useless.
> 
> Anyway...
> 
> 
> Subject: mm/page_alloc.c: don't cache `current' in a local
> From: Andrew Morton <akpm@linux-foundation.org>
> 
> It's old-fashioned and unneeded.
> 
> akpm:/usr/src/25> size mm/page_alloc.o
>    text    data     bss     dec     hex filename
>   39884 1241317   18808 1300009  13d629 mm/page_alloc.o (before)
>   39838 1241317   18808 1299963  13d5fb mm/page_alloc.o (after)
> 
> Cc: David Rientjes <rientjes@google.com>
> Cc: Mel Gorman <mel@csn.ul.ie>
> Cc: Hugh Dickins <hughd@google.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

Looks spot on. The slight text saving is a bonus and I imagine there are
small savings on stack usage as well.

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

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

      parent reply	other threads:[~2011-01-12  9:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <201101112046.p0BKk2Js005902@imap1.linux-foundation.org>
2011-01-11 21:43 ` + mm-vmscan-reclaim-order-0-and-use-compaction-instead-of-lumpy-reclaim-avoid-a-potential-deadlock-due-to-lock_page-during-direct-compaction-fix.patch added to -mm tree David Rientjes
2011-01-11 21:55   ` Andrew Morton
2011-01-11 22:01     ` David Rientjes
2011-01-12  9:28     ` 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=20110112092812.GH11932@csn.ul.ie \
    --to=mel@csn.ul.ie \
    --cc=akpm@linux-foundation.org \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rientjes@google.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