From: Yasunori Goto <ygoto@us.fujitsu.com>
To: lhms-devel@lists.sourceforge.net, linux-mm@kvack.org
Subject: [RFC/Patch]Making Removable zone[4/4]
Date: Mon, 25 Oct 2004 19:38:25 -0700 [thread overview]
Message-ID: <20041025193707.6919.YGOTO@us.fujitsu.com> (raw)
In-Reply-To: <20041025160642.690F.YGOTO@us.fujitsu.com>
This patch is just for test to make removable zones.
--
hotremovable-goto/arch/i386/mm/init.c | 22 +++++++++++++++++++---
1 files changed, 19 insertions(+), 3 deletions(-)
diff -puN arch/i386/mm/init.c~removable arch/i386/mm/init.c
--- hotremovable/arch/i386/mm/init.c~removable Fri Aug 27 21:07:12 2004
+++ hotremovable-goto/arch/i386/mm/init.c Fri Aug 27 21:07:12 2004
@@ -512,22 +512,38 @@ void zap_low_mappings (void)
}
#ifndef CONFIG_DISCONTIGMEM
+
+unsigned int __init check_max_unremovable(void)
+{
+ /* XXX : Hardware information might be necessary.
+ Now is just for test */
+ return (highend_pfn + max_low_pfn) / 2;
+}
+
void __init zone_sizes_init(void)
{
- unsigned long zones_size[MAX_NR_ZONES] = {0, 0, 0};
- unsigned int max_dma, high, low;
+ unsigned long zones_size[MAX_NR_ZONES] = {0, 0, 0, 0, 0, 0};
+ unsigned int max_dma, high, low, max_unremovable;
max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT;
low = max_low_pfn;
high = highend_pfn;
+ max_unremovable = check_max_unremovable();
+
if (low < max_dma)
zones_size[ZONE_DMA] = low;
else {
zones_size[ZONE_DMA] = max_dma;
zones_size[ZONE_NORMAL] = low - max_dma;
#ifdef CONFIG_HIGHMEM
- zones_size[ZONE_HIGHMEM] = high - low;
+ if( low >= max_unremovable )
+ zones_size[ZONE_HIGHMEM_RMV] = high - low;
+ else if( high > max_unremovable ){
+ zones_size[ZONE_HIGHMEM_RMV] = high - max_unremovable;
+ zones_size[ZONE_HIGHMEM] = max_unremovable - low;
+ }else
+ zones_size[ZONE_HIGHMEM] = high - low;
#endif
}
free_area_init(zones_size);
_
--
Yasunori Goto <ygoto at us.fujitsu.com>
--
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:"aart@kvack.org"> aart@kvack.org </a>
prev parent reply other threads:[~2004-10-26 2:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-26 2:24 [RFC/Patch]Making Removable zone[0/4] Yasunori Goto
2004-10-26 2:34 ` [RFC/Patch]Making Removable zone[1/4] Yasunori Goto
2004-10-26 2:35 ` [RFC/Patch]Making Removable zone[2/4] Yasunori Goto
2004-10-26 2:36 ` [RFC/Patch]Making Removable zone[3/4] Yasunori Goto
2004-10-26 2:38 ` 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=20041025193707.6919.YGOTO@us.fujitsu.com \
--to=ygoto@us.fujitsu.com \
--cc=lhms-devel@lists.sourceforge.net \
--cc=linux-mm@kvack.org \
/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