From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
To: Mel Gorman <mel@csn.ul.ie>
Cc: kosaki.motohiro@jp.fujitsu.com,
Minchan Kim <minchan.kim@gmail.com>,
Huang Shijie <shijie8@gmail.com>,
akpm@linux-foundation.org, linux-mm@kvack.org,
Christoph Lameter <cl@linux-foundation.org>
Subject: Re: [PATCH] page allocator: fix update NR_FREE_PAGES only as necessary
Date: Tue, 5 Jan 2010 10:08:23 +0900 (JST) [thread overview]
Message-ID: <20100105100706.96C9.A69D9226@jp.fujitsu.com> (raw)
In-Reply-To: <20100104095820.GA6373@csn.ul.ie>
> > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> > > index 4e4b5b3..87976ad 100644
> > > --- a/mm/page_alloc.c
> > > +++ b/mm/page_alloc.c
> > > @@ -1244,6 +1244,9 @@ again:
> > > return page;
> > >
> > > failed:
> > > + spin_lock(&zone->lock);
> > > + __mod_zone_page_state(zone, NR_FREE_PAGES, 1 << order);
> > > + spin_unlock(&zone->lock);
> > > local_irq_restore(flags);
> > > put_cpu();
> > > return NULL;
> >
> > Why can't we write following? __mod_zone_page_state() only require irq
> > disabling, it doesn't need spin lock. I think.
> >
>
> Adding Christoph to be sure but yes, as this is a per-cpu variable it
> should be safe to update with __mod_zone_page_state() as long as
> interrupts and preempt are disabled. If true, then this is a neater fix
> and is also needed for -stable 2.6.31 and 2.6.32.
>
> Well spotted and thanks.
Yes, it should be sent to -stable tree. I hope this fix also solve recent mysterious
allocation failure problem ;-)
--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2010-01-05 1:08 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-04 2:22 [PATCH] mm : add check for the return value Huang Shijie
2010-01-04 3:21 ` Minchan Kim
2010-01-04 4:10 ` shijie8
2010-01-04 4:48 ` Minchan Kim
2010-01-04 5:18 ` Huang Shijie
2010-01-04 6:06 ` Minchan Kim
2010-01-08 22:59 ` Andrew Morton
2010-01-04 5:52 ` [PATCH] page allocator: fix update NR_FREE_PAGES only as necessary KOSAKI Motohiro
2010-01-04 6:03 ` Minchan Kim
2010-01-04 6:11 ` Huang Shijie
2010-01-04 6:16 ` KOSAKI Motohiro
2010-01-04 9:35 ` Huang Shijie
2010-01-05 7:24 ` KOSAKI Motohiro
2010-01-04 9:58 ` Mel Gorman
2010-01-04 17:46 ` Christoph Lameter
2010-01-05 1:08 ` KOSAKI Motohiro [this message]
2010-01-08 23:02 ` Andrew Morton
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=20100105100706.96C9.A69D9226@jp.fujitsu.com \
--to=kosaki.motohiro@jp.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=cl@linux-foundation.org \
--cc=linux-mm@kvack.org \
--cc=mel@csn.ul.ie \
--cc=minchan.kim@gmail.com \
--cc=shijie8@gmail.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