Messages in this thread | | | Date | Wed, 12 Jan 2011 09:28:12 +0000 | From | Mel Gorman <> | 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@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
| |