linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Kiper <dkiper@net-space.pl>
To: Dave Hansen <dave@linux.vnet.ibm.com>
Cc: Daniel Kiper <dkiper@net-space.pl>,
	ian.campbell@citrix.com, akpm@linux-foundation.org,
	andi.kleen@intel.com, haicheng.li@linux.intel.com,
	fengguang.wu@intel.com, jeremy@goop.org, konrad.wilk@oracle.com,
	dan.magenheimer@oracle.com, v.tolstov@selfip.ru, pasik@iki.fi,
	wdauchy@gmail.com, rientjes@google.com,
	xen-devel@lists.xensource.com, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org
Subject: Re: [PATCH 3/3] mm: Extend memory hotplug API to allow memory hotplug in virtual machines
Date: Tue, 29 Mar 2011 20:32:42 +0200	[thread overview]
Message-ID: <20110329183242.GE30387@router-fw-old.local.net-space.pl> (raw)
In-Reply-To: <1301329524.31700.8440.camel@nimitz>

On Mon, Mar 28, 2011 at 09:25:24AM -0700, Dave Hansen wrote:
> On Mon, 2011-03-28 at 11:25 +0200, Daniel Kiper wrote:
> > This patch contains online_page_chain and apropriate functions
> > for registering/unregistering online page notifiers. It allows
> > to do some machine specific tasks during online page stage which
> > is required to implement memory hotplug in virtual machines.
> > Additionally, __online_page_increment_counters() and
> > __online_page_free() function was add to ease generic
> > hotplug operation.
>
> I really like that you added some symbolic constants there.  It makes it
> potentially a lot more readable.
>
> My worry is that the next person who comes along is going to _really_
> scratch their head asking why they would use:
> OP_DO_NOT_INCREMENT_TOTAL_COUNTERS or: OP_INCREMENT_TOTAL_COUNTERS.
> There aren't any code comments about it, and the patch description
> doesn't really help.
>
> In the end, we're only talking about a couple of lines of code for each
> case (reordering the function a bit too):
>
>         void online_page(struct page *page)
>         {
>         // 1. pfn-based bits upping the max physical address markers:
>                 unsigned long pfn = page_to_pfn(page);
>                 if (pfn >= num_physpages)
>                         num_physpages = pfn + 1;
>         #ifdef CONFIG_FLATMEM
>                 max_mapnr = max(page_to_pfn(page), max_mapnr);
>         #endif
>
>         // 2. number of pages counters:
>                 totalram_pages++;
>         #ifdef CONFIG_HIGHMEM
>                 if (PageHighMem(page))
>                         totalhigh_pages++;
>         #endif
>
>         // 3. preparing 'struct page' and freeing:
>                 ClearPageReserved(page);
>                 init_page_count(page);
>                 __free_page(page);
>         }
>
> Your stuff already extracted the free stuff very nicely.  I think now we
> just need to separate out the totalram_pages/totalhigh_pages bits from
> the num_physpages/max_mapnr ones.

What do you think about __online_page_increment_counters()
(totalram_pages and totalhigh_pages) and
__online_page_set_limits() (num_physpages and max_mapnr) ???

Daniel

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2011-03-29 18:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-28  9:25 Daniel Kiper
2011-03-28 16:25 ` Dave Hansen
2011-03-29 18:32   ` Daniel Kiper [this message]
2011-03-30 14:26     ` Dave Hansen
2011-03-28 22:37 ` Andrew Morton
2011-03-29 13:23   ` Konrad Rzeszutek Wilk
2011-03-29 18:59   ` Daniel Kiper
2011-03-29 19:15     ` Andrew Morton
2011-03-29 20:33       ` Dave Hansen
2011-03-29 21:53       ` Daniel Kiper

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=20110329183242.GE30387@router-fw-old.local.net-space.pl \
    --to=dkiper@net-space.pl \
    --cc=akpm@linux-foundation.org \
    --cc=andi.kleen@intel.com \
    --cc=dan.magenheimer@oracle.com \
    --cc=dave@linux.vnet.ibm.com \
    --cc=fengguang.wu@intel.com \
    --cc=haicheng.li@linux.intel.com \
    --cc=ian.campbell@citrix.com \
    --cc=jeremy@goop.org \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=pasik@iki.fi \
    --cc=rientjes@google.com \
    --cc=v.tolstov@selfip.ru \
    --cc=wdauchy@gmail.com \
    --cc=xen-devel@lists.xensource.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