linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dave Hansen <haveblue@us.ibm.com>
To: Yasunori Goto <y-goto@jp.fujitsu.com>
Cc: "Luck, Tony" <tony.luck@intel.com>,
	Linux Hotplug Memory Support <lhms-devel@lists.sourceforge.net>,
	linux-ia64@vger.kernel.org,
	Linux Kernel ML <linux-kernel@vger.kernel.org>,
	linux-mm <linux-mm@kvack.org>, Bob Picco <bob.picco@hp.com>,
	Mike Kravetz <kravetz@us.ibm.com>
Subject: Re: [PATCH] Simple memory hot-add for ia64.
Date: Fri, 06 Jan 2006 11:21:36 -0800	[thread overview]
Message-ID: <1136575296.8189.25.camel@localhost.localdomain> (raw)
In-Reply-To: <20060106114249.5649.Y-GOTO@jp.fujitsu.com>

On Fri, 2006-01-06 at 11:50 +0900, Yasunori Goto wrote:
> Fortunately, 2.6.15 includes memory hot-add function for i386 and ppc.
> So, I made a patch for ia64.
> This doesn't make new pgdat. All of new memory will belong to
> node 0 by this patch. But this is simplest first step and best start for
> future work.

It does look quite simple.  Nice work.

> +#ifdef CONFIG_MEMORY_HOTPLUG
> +void online_page(struct page *page)
> +{
> +	ClearPageReserved(page);
> +	set_page_count(page, 1);
> +	__free_page(page);
> +	totalram_pages++;
> +	num_physpages++;
> +}

You're the first one to get one of these in for an alternate
architecture.  We'll need to keep an eye out so that one of these
doesn't pop up on each of the 64-bit arches with no highmem as we add
support.  But, this should be just fine for now. 

> +int add_memory(u64 start, u64 size)
> +{
> +	pg_data_t *pgdat;
> +	struct zone *zone;
> +	unsigned long start_pfn = start >> PAGE_SHIFT;
> +	unsigned long nr_pages = size >> PAGE_SHIFT;
> +	int ret;
> +
> +	pgdat = NODE_DATA(0);
> +
> +	zone = pgdat->node_zones + ZONE_NORMAL;
> +	ret = __add_pages(zone, start_pfn, nr_pages);
> +
> +	if (ret)
> +		printk("%s: Problem encountered in __add_pages() as ret=%d\n", __func__,  ret);

For some reason, I thought we were officially supposed to use
__FUNCTION__ for stuff like this.  However, I am usually lazy in my
debugging patches and use __func__.  I'm a bad example.

This also looks a bit past 80 columns.

-- Dave

--
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:[~2006-01-06 19:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-06  2:50 Yasunori Goto
2006-01-06 19:21 ` Dave Hansen [this message]
2006-01-07  2:50   ` Yasunori Goto

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=1136575296.8189.25.camel@localhost.localdomain \
    --to=haveblue@us.ibm.com \
    --cc=bob.picco@hp.com \
    --cc=kravetz@us.ibm.com \
    --cc=lhms-devel@lists.sourceforge.net \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=tony.luck@intel.com \
    --cc=y-goto@jp.fujitsu.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