From: Yasunori Goto <y-goto@jp.fujitsu.com>
To: Nathan Fontenot <nfont@austin.ibm.com>
Cc: linux-kernel@vger.kernel.org, Badari Pulavarty <pbadari@us.ibm.com>
Subject: Re: [PATCH] release memory regions in PAGES_PER_SECTION chunks
Date: Tue, 14 Oct 2008 20:59:59 +0900 [thread overview]
Message-ID: <20081014205507.AD7F.E1E9C6FF@jp.fujitsu.com> (raw)
In-Reply-To: <48F3ADEF.1080905@austin.ibm.com>
Good catch.
Looks good to me.
Acked-by: Yasunori Goto <y-goto@jp.fujitsu.com>
> During hotplug memory remove, memory regions should be released
> on a PAGES_PER_SECTION size chunks. This mirrors the code in
> add_memory where resources are requested on a PAGES_PER_SECTION size.
>
> Attempting to release the entire memory region fails because there is
> not a single resource for the total number of pages being removed.
> Instead the resources for the pages are split in PAGES_PER_SECTION
> size chunks as requested during memory add.
>
> Signed-off-by: Nathan Fontenot <nfont@austin.ibm.com>
> Signed-off-by: Badari Pulavarty <pbadari@us.ibm.com>
>
> ---
>
> Index: linux-2.6/mm/memory_hotplug.c
> ===================================================================
> --- linux-2.6.orig/mm/memory_hotplug.c 2008-10-13 12:00:46.000000000 -0500
> +++ linux-2.6/mm/memory_hotplug.c 2008-10-13 14:29:31.000000000 -0500
> @@ -323,11 +323,11 @@
> BUG_ON(phys_start_pfn & ~PAGE_SECTION_MASK);
> BUG_ON(nr_pages % PAGES_PER_SECTION);
>
> - release_mem_region(phys_start_pfn << PAGE_SHIFT, nr_pages * PAGE_SIZE);
> -
> sections_to_remove = nr_pages / PAGES_PER_SECTION;
> for (i = 0; i < sections_to_remove; i++) {
> unsigned long pfn = phys_start_pfn + i*PAGES_PER_SECTION;
> + release_mem_region(pfn << PAGE_SHIFT,
> + PAGES_PER_SECTION << PAGE_SHIFT);
> ret = __remove_section(zone, __pfn_to_section(pfn));
> if (ret)
> break;
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
--
Yasunori Goto
prev parent reply other threads:[~2008-10-14 12:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-13 20:22 [PATCH] release memory regions in PAGES_PER_SECTION chunks Nathan Fontenot
2008-10-14 11:59 ` Yasunori Goto [this message]
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=20081014205507.AD7F.E1E9C6FF@jp.fujitsu.com \
--to=y-goto@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nfont@austin.ibm.com \
--cc=pbadari@us.ibm.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