lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20110112092812.GH11932@csn.ul.ie>
Date:	Wed, 12 Jan 2011 09:28:12 +0000
From:	Mel Gorman <mel@....ul.ie>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	David Rientjes <rientjes@...gle.com>, linux-kernel@...r.kernel.org,
	hughd@...gle.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

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@...gle.com> wrote:
> 
> > On Tue, 11 Jan 2011, akpm@...ux-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@...ux-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@...gle.com>
> Cc: Mel Gorman <mel@....ul.ie>
> Cc: Hugh Dickins <hughd@...gle.com>
> Signed-off-by: Andrew Morton <akpm@...ux-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@....ul.ie>

-- 
Mel Gorman
Part-time Phd Student                          Linux Technology Center
University of Limerick                         IBM Dublin Software Lab
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ