From: Michal Hocko <mhocko@suse.cz>
To: Hiroyuki Kamezawa <kamezawa.hiroyuki@gmail.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
fengguang.wu@intel.com,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
Mel Gorman <mel@csn.ul.ie>,
andi.kleen@intel.com, Dave Hansen <dave@linux.vnet.ibm.com>
Subject: Re: [PATCH 3/3] memory hotplug: use unified logic for is_removable and offline_pages
Date: Tue, 7 Sep 2010 15:16:12 +0200 [thread overview]
Message-ID: <20100907131612.GA23617@tiehlicka.suse.cz> (raw)
In-Reply-To: <AANLkTikOi6BqXs2wiLetFP9OgYtXD+vbC+Ez8a7z0dcU@mail.gmail.com>
On Mon 06-09-10 22:30:43, Hiroyuki Kamezawa wrote:
> 2010/9/6 Michal Hocko <mhocko@suse.cz>:
> > On Mon 06-09-10 14:47:16, KAMEZAWA Hiroyuki wrote:
[...]
> >> Changelog: 2010/09/06
> >> ?- added comments.
> >> ?- removed zone->lock.
> >> ?- changed the name of the function to be is_pageblock_removable_async().
> >> ? ?because I removed the zone->lock.
> >
> > wouldn't be __is_pageblock_removable a better name? _async suffix is
> > usually used for asynchronous operations and this is just a function
> > withtout locks.
> >
> rename as _is_pagebloc_removable_nolock().
Sounds good as well.
[...]
> >> +bool is_pageblock_removable_async(struct page *page)
> >> +{
> >> + ? ? struct zone *zone = page_zone(page);
> >> + ? ? unsigned long flags;
> >> + ? ? int num;
> >> + ? ? /* Don't take zone->lock interntionally. */
> >
> > Could you add the reason?
> > Don't take zone-> lock intentionally because we are called from the
> > userspace (sysfs interface).
> >
> I don't like to assume caller context which will limit the callers.
>
> /* holding zone->lock or not is caller's job. */
Sure, but I think that if you explicitely mention that the lock is not
held intentionaly then it would be good to provide some reasonining.
>
>
> > [...]
> >> ? ? ? /* All pageblocks in the memory block are likely to be hot-removable */
> >> Index: kametest/include/linux/memory_hotplug.h
> >> ===================================================================
> >> --- kametest.orig/include/linux/memory_hotplug.h
> >> +++ kametest/include/linux/memory_hotplug.h
> >> @@ -69,6 +69,7 @@ extern void online_page(struct page *pag
> >> ?/* VM interface that may be used by firmware interface */
> >> ?extern int online_pages(unsigned long, unsigned long);
> >> ?extern void __offline_isolated_pages(unsigned long, unsigned long);
> >
> > #ifdef CONFIG_HOTREMOVE
> >
> >> +extern bool is_pageblock_removable_async(struct page *page);
> >
> > #else
> > #define is_pageblock_removable_async(p) 0
> > #endif
> > ?
>
> Is this function is called even if HOTREMOVE is off ?
> If so, the caller is buggy. I'll check tomorrow.
It is not, but then it should be defined under CONFIG_HOTREMOVE without
#else part, shoudln't it?
>
> Thanks,
> -Kame
Thanks!
--
Michal Hocko
L3 team
SUSE LINUX s.r.o.
Lihovarska 1060/12
190 00 Praha 9
Czech Republic
--
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-09-07 13:16 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-06 5:40 [PATCH 0/3] memory hotplug: updates and bugfix for is_removable KAMEZAWA Hiroyuki
2010-09-06 5:42 ` [BUGFIX][PATCH 1/3] memory hotplug: fix next block calculation in is_removable KAMEZAWA Hiroyuki
2010-09-06 13:39 ` Mel Gorman
2010-09-06 17:15 ` Hiroyuki Kamezawa
2010-09-07 9:30 ` Mel Gorman
2010-09-06 5:44 ` [PATCH 2/3] memory hotplug: fix set_migratetype_isolate wrong callback result check KAMEZAWA Hiroyuki
2010-09-06 5:47 ` [PATCH 3/3] memory hotplug: use unified logic for is_removable and offline_pages KAMEZAWA Hiroyuki
2010-09-06 9:30 ` Michal Hocko
2010-09-06 13:30 ` Hiroyuki Kamezawa
2010-09-07 13:16 ` Michal Hocko [this message]
2010-09-06 13:58 ` Mel Gorman
2010-09-06 23:58 ` KAMEZAWA Hiroyuki
2010-09-07 13:01 ` Mel Gorman
2010-09-07 1:28 ` [PATCH 0/3] memory hotplug: updates and bugfix for is_removable v3 KAMEZAWA Hiroyuki
2010-09-07 1:32 ` [PATCH 1/3] [BUGFIX] memory hotplug: fix next block calculation in is_removable KAMEZAWA Hiroyuki
2010-09-08 11:23 ` Mel Gorman
2010-09-07 1:34 ` [PATCH 2/3][BUGFIX] memory hotplug: fix notifier's return value check KAMEZAWA Hiroyuki
2010-09-07 1:36 ` [PATCH 3/3] memory hotplug: unify is_removable and offline detection code KAMEZAWA Hiroyuki
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=20100907131612.GA23617@tiehlicka.suse.cz \
--to=mhocko@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=andi.kleen@intel.com \
--cc=dave@linux.vnet.ibm.com \
--cc=fengguang.wu@intel.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=kamezawa.hiroyuki@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mel@csn.ul.ie \
/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).