All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Jiang Liu <liuj97@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	David Rientjes <rientjes@google.com>,
	Jiang Liu <jiang.liu@huawei.com>,
	Wen Congyang <wency@cn.fujitsu.com>, Mel Gorman <mgorman@suse.de>,
	Minchan Kim <minchan@kernel.org>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Michal Hocko <mhocko@suse.cz>,
	James Bottomley <James.Bottomley@HansenPartnership.com>,
	Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>,
	David Howells <dhowells@redhat.com>,
	Mark Salter <msalter@redhat.com>,
	Jianguo Wu <wujianguo@huawei.com>,
	linux-mm@kvack.org, linux-arch@vger.kernel.org,
	linux-kernel@vger.kernel.org, Tang Chen <tangchen@cn.fujitsu.com>,
	Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Subject: Re: [PATCH v3, part4 38/39] mm/hotplug: prepare for removing num_physpages
Date: Fri, 29 Mar 2013 17:40:14 +0100	[thread overview]
Message-ID: <20130329164014.GA6266@merkur.ravnborg.org> (raw)
In-Reply-To: <5155C196.5020909@gmail.com>

On Sat, Mar 30, 2013 at 12:30:14AM +0800, Jiang Liu wrote:
> On 03/30/2013 12:17 AM, Sam Ravnborg wrote:
> >>>> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> >>>> index 97454b3..9b1b494 100644
> >>>> --- a/mm/memory_hotplug.c
> >>>> +++ b/mm/memory_hotplug.c
> >>>> @@ -751,10 +751,6 @@ EXPORT_SYMBOL_GPL(restore_online_page_callback);
> >>>>  
> >>>>  void __online_page_set_limits(struct page *page)
> >>>>  {
> >>>> -	unsigned long pfn = page_to_pfn(page);
> >>>> -
> >>>> -	if (pfn >= num_physpages)
> >>>> -		num_physpages = pfn + 1;
> >>>>  }
> >>>>  EXPORT_SYMBOL_GPL(__online_page_set_limits);
> >>>
> >>> How can this be correct?
> >>> With this change __online_page_set_limits() is now a nop.
> >> Hi Sam,
> >> 	We will eventually remove the global variable num_physpages in the last patch.
> >> I kept the nop __online_page_set_limits() because I have a plan to use it to fix other
> >> bugs in memory hotplug, otherwise it may be killed too.
> > 
> > The xen ballon driver uses __online_page_set_limits for memory
> > hotplug - so this will break this driver afaics.
> Hi Sam,
> 	I haven't gotten your point yet here. 
> 	Function __online_page_set_limits() was only used to update the global variable
> num_physpages, and one of the goals of this patch set is to get rid of num_physpages.
> So I think it won't break Xen balloon driver.
> 	Please refer to the patch here, which eventually kills num_physpages.
> http://marc.info/?l=linux-mm&m=136431387813309&w=2

I assumed that num_physpages was used run-time to check for the
available number of pages. And __online_page_set_limits() were used
to reduced the number of online pages.

But a quick grep did not reveal any such use.

So it looks OK - thanks for the clarification.

	Sam

WARNING: multiple messages have this Message-ID (diff)
From: Sam Ravnborg <sam@ravnborg.org>
To: Jiang Liu <liuj97@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	David Rientjes <rientjes@google.com>,
	Jiang Liu <jiang.liu@huawei.com>,
	Wen Congyang <wency@cn.fujitsu.com>, Mel Gorman <mgorman@suse.de>,
	Minchan Kim <minchan@kernel.org>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Michal Hocko <mhocko@suse.cz>,
	James Bottomley <James.Bottomley@HansenPartnership.com>,
	Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>,
	David Howells <dhowells@redhat.com>,
	Mark Salter <msalter@redhat.com>,
	Jianguo Wu <wujianguo@huawei.com>,
	linux-mm@kvack.org, linux-arch@vger.kernel.org,
	linux-kernel@vger.kernel.org, Tang Chen <tangchen@cn.fujitsu.com>,
	Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Subject: Re: [PATCH v3, part4 38/39] mm/hotplug: prepare for removing num_physpages
Date: Fri, 29 Mar 2013 17:40:14 +0100	[thread overview]
Message-ID: <20130329164014.GA6266@merkur.ravnborg.org> (raw)
In-Reply-To: <5155C196.5020909@gmail.com>

On Sat, Mar 30, 2013 at 12:30:14AM +0800, Jiang Liu wrote:
> On 03/30/2013 12:17 AM, Sam Ravnborg wrote:
> >>>> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> >>>> index 97454b3..9b1b494 100644
> >>>> --- a/mm/memory_hotplug.c
> >>>> +++ b/mm/memory_hotplug.c
> >>>> @@ -751,10 +751,6 @@ EXPORT_SYMBOL_GPL(restore_online_page_callback);
> >>>>  
> >>>>  void __online_page_set_limits(struct page *page)
> >>>>  {
> >>>> -	unsigned long pfn = page_to_pfn(page);
> >>>> -
> >>>> -	if (pfn >= num_physpages)
> >>>> -		num_physpages = pfn + 1;
> >>>>  }
> >>>>  EXPORT_SYMBOL_GPL(__online_page_set_limits);
> >>>
> >>> How can this be correct?
> >>> With this change __online_page_set_limits() is now a nop.
> >> Hi Sam,
> >> 	We will eventually remove the global variable num_physpages in the last patch.
> >> I kept the nop __online_page_set_limits() because I have a plan to use it to fix other
> >> bugs in memory hotplug, otherwise it may be killed too.
> > 
> > The xen ballon driver uses __online_page_set_limits for memory
> > hotplug - so this will break this driver afaics.
> Hi Sam,
> 	I haven't gotten your point yet here. 
> 	Function __online_page_set_limits() was only used to update the global variable
> num_physpages, and one of the goals of this patch set is to get rid of num_physpages.
> So I think it won't break Xen balloon driver.
> 	Please refer to the patch here, which eventually kills num_physpages.
> http://marc.info/?l=linux-mm&m=136431387813309&w=2

I assumed that num_physpages was used run-time to check for the
available number of pages. And __online_page_set_limits() were used
to reduced the number of online pages.

But a quick grep did not reveal any such use.

So it looks OK - thanks for the clarification.

	Sam

--
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>

  reply	other threads:[~2013-03-29 16:40 UTC|newest]

Thread overview: 111+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-26 15:54 [PATCH v3, part4 00/39] Simplify mem_init() implementations and kill num_physpages Jiang Liu
2013-03-26 15:54 ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 01/39] vmlinux.lds: add comments for global variables and clean up useless declarations Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 02/39] avr32: normalize global variables exported by vmlinux.lds Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 03/39] c6x: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 04/39] h8300: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 05/39] score: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 06/39] tile: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 07/39] UML: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 08/39] mm: introduce helper function mem_init_print_info() to simplify mem_init() Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 09/39] mm: use totalram_pages instead of num_physpages at runtime Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 10/39] mm/alpha: prepare for removing num_physpages and simplify mem_init() Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 11/39] mm/ARM: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 12/39] mm/ARM64: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 13/39] mm/AVR32: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 14/39] mm/blackfin: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 15/39] mm/c6x: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 16/39] mm/cris: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 17/39] mm/frv: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 18/39] mm/h8300: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 19/39] mm/hexagon: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 20/39] mm/IA64: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 21/39] mm/m32r: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 22/39] mm/m68k: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 23/39] mm/microblaze: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 24/39] mm/MIPS: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 25/39] mm/mn10300: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 26/39] mm/openrisc: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-04-02  5:31   ` Jonas Bonn
2013-04-02  5:31     ` Jonas Bonn
2013-04-02  5:31     ` Jonas Bonn
2013-04-02  5:31     ` Jonas Bonn
2013-04-02 14:38     ` Jiang Liu
2013-04-02 14:38       ` Jiang Liu
2013-04-02 14:38       ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 27/39] mm/PARISC: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 28/39] mm/ppc: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 29/39] mm/s390: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 30/39] mm/score: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 31/39] mm/SH: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 32/39] mm/SPARC: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-29 16:17   ` Sam Ravnborg
2013-03-29 16:17     ` Sam Ravnborg
2013-03-29 16:17     ` Sam Ravnborg
2013-03-26 15:54 ` [PATCH v3, part4 33/39] mm/tile: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 34/39] mm/um: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 35/39] mm/unicore32: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 36/39] mm/x86: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 37/39] mm/xtensa: " Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 38/39] mm/hotplug: prepare for removing num_physpages Jiang Liu
2013-03-26 15:54   ` Jiang Liu
2013-03-29 11:18   ` Sam Ravnborg
2013-03-29 11:18     ` Sam Ravnborg
2013-03-29 15:36     ` Jiang Liu
2013-03-29 15:36       ` Jiang Liu
2013-03-29 16:17       ` Sam Ravnborg
2013-03-29 16:17         ` Sam Ravnborg
2013-03-29 16:30         ` Jiang Liu
2013-03-29 16:30           ` Jiang Liu
2013-03-29 16:40           ` Sam Ravnborg [this message]
2013-03-29 16:40             ` Sam Ravnborg
2013-03-29 16:42             ` Jiang Liu
2013-03-29 16:42               ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 39/39] mm: kill global variable num_physpages Jiang Liu
2013-03-26 15:54   ` Jiang Liu

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=20130329164014.GA6266@merkur.ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=isimatu.yasuaki@jp.fujitsu.com \
    --cc=jiang.liu@huawei.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=liuj97@gmail.com \
    --cc=mgorman@suse.de \
    --cc=mhocko@suse.cz \
    --cc=minchan@kernel.org \
    --cc=msalter@redhat.com \
    --cc=rientjes@google.com \
    --cc=sergei.shtylyov@cogentembedded.com \
    --cc=tangchen@cn.fujitsu.com \
    --cc=wency@cn.fujitsu.com \
    --cc=wujianguo@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.