From: Andrew Morton <akpm@linux-foundation.org>
To: Michal Hocko <mhocko@suse.cz>
Cc: Wu Fengguang <fengguang.wu@intel.com>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
Mel Gorman <mel@csn.ul.ie>
Subject: Re: [BUGFIX][PATCH] fix is_mem_section_removable() page_order BUG_ON check.
Date: Mon, 25 Oct 2010 14:24:42 -0700 [thread overview]
Message-ID: <20101025142442.9cf4fd19.akpm@linux-foundation.org> (raw)
In-Reply-To: <20101025131025.GA18570@tiehlicka.suse.cz>
On Mon, 25 Oct 2010 15:10:25 +0200
Michal Hocko <mhocko@suse.cz> wrote:
> On Mon 25-10-10 15:49:33, Wu Fengguang wrote:
> > On Mon, Oct 25, 2010 at 02:37:26PM +0800, KAMEZAWA Hiroyuki wrote:
> > > I wonder this should be for stable tree...but want to hear opinions before.
> > > ==
> > > From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> > >
> > > page_order() is called by memory hotplug's user interface to check
> > > the section is removable or not. (is_mem_section_removable())
> > >
> > > It calls page_order() withoug holding zone->lock.
> > > So, even if the caller does
> > >
> > > if (PageBuddy(page))
> > > ret = page_order(page) ...
> > > The caller may hit BUG_ON().
> > >
> > > For fixing this, there are 2 choices.
> > > 1. add zone->lock.
> > > 2. remove BUG_ON().
> >
> > One more alternative might be to introduce a private
> > maybe_page_order() for is_mem_section_removable(). Not a big deal.
>
> I guess this is not necessary as all page_order callers check PageBuddy
> anyway AFAICS.
And hold zone->lock, one hopes.
> >
> > > is_mem_section_removable() is used for some "advice" and doesn't need
> > > to be 100% accurate. This is_removable() can be called via user program..
> > > We don't want to take this important lock for long by user's request.
> > > So, this patch removes BUG_ON().
> >
> > Acked-by: Wu Fengguang <fengguang.wu@intel.com>
>
> Yes, the change looks good.
It removes a valid assertion because one of the callers is doing
something exceptional. That exceptional caller should implement the
exceptional code, rather than weakening useful code for other callers!
But I'll grab the patch anyway, since BUG_ON in an inlined function is
a pretty bad idea from a bloat POV.
--
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-10-25 21:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-25 6:37 [BUGFIX][PATCH] fix is_mem_section_removable() page_order BUG_ON check KAMEZAWA Hiroyuki
2010-10-25 7:49 ` Wu Fengguang
2010-10-25 13:10 ` Michal Hocko
2010-10-25 13:16 ` Wu Fengguang
2010-10-25 21:24 ` Andrew Morton [this message]
2010-10-25 17:03 ` Mel Gorman
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=20101025142442.9cf4fd19.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=fengguang.wu@intel.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-mm@kvack.org \
--cc=mel@csn.ul.ie \
--cc=mhocko@suse.cz \
/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;
as well as URLs for NNTP newsgroup(s).