public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Zou Nan hai <nanhai.zou@intel.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: ak@suse.de, suresh.b.siddha@intel.com, Andrew Morton <akpm@osdl.org>
Subject: [Patch] Allocate sparsemem memmap above 4G on X86_64
Date: 17 May 2007 10:40:07 +0800	[thread overview]
Message-ID: <1179369607.4103.158.camel@linux-znh> (raw)

On system with huge amount of physical memory. 
VFS cache and memory memmap may eat all available system memory under
4G, then system may fail to allocated swiotlb bounce buffer. 

There was a fix in arch/x86_64/mm/numa.c, but that fix does not cover
sparsemem model.
This patch add fix to sparsemem model.

Signed-off-by: Zou Nan hai <nanhai.zou@intel.com>
Acked-by: Siddha, Suresh <suresh.b.siddha@intel.com>
---
 include/asm-x86_64/mmzone.h |    5 +++++
 include/linux/bootmem.h     |    3 +++
 mm/sparse.c                 |    5 +++++
 3 files changed, 13 insertions(+)

diff -Nraup a/include/asm-x86_64/mmzone.h b/include/asm-x86_64/mmzone.h
--- a/include/asm-x86_64/mmzone.h	2007-05-17 09:38:02.000000000 +0800
+++ b/include/asm-x86_64/mmzone.h	2007-05-17 09:54:10.000000000 +0800
@@ -52,5 +52,10 @@ extern int pfn_valid(unsigned long pfn);
 #define FAKE_NODE_MIN_HASH_MASK	(~(FAKE_NODE_MIN_SIZE - 1uL))
 #endif
 
+#define ARCH_HAS_ALLOC_BOOTMEM_HIGH_NODE 1
+#define alloc_bootmem_high_node(pgdat,size) \
+({__alloc_bootmem_core(pgdat->bdata, size, SMP_CACHE_BYTES, (4UL*1024*1024*1024), 0);})
+
+
 #endif
 #endif
diff -Nraup a/include/linux/bootmem.h b/include/linux/bootmem.h
--- a/include/linux/bootmem.h	2007-05-17 09:38:02.000000000 +0800
+++ b/include/linux/bootmem.h	2007-05-17 09:37:00.000000000 +0800
@@ -131,5 +131,8 @@ extern void *alloc_large_system_hash(con
 #endif
 extern int hashdist;		/* Distribute hashes across NUMA nodes? */
 
+#ifndef ARCH_HAS_ALLOC_BOOTMEM_HIGH_NODE
+#define alloc_bootmem_high_node(pgdat, size) ({NULL;})
+#endif
 
 #endif /* _LINUX_BOOTMEM_H */
diff -Nraup a/mm/sparse.c b/mm/sparse.c
--- a/mm/sparse.c	2007-05-17 09:38:03.000000000 +0800
+++ b/mm/sparse.c	2007-05-17 09:54:27.000000000 +0800
@@ -219,6 +219,11 @@ static struct page __init *sparse_early_
 	if (map)
 		return map;
 
+	map = alloc_bootmem_high_node(NODE_DATA(nid),
+			sizeof(struct page) * PAGES_PER_SECTION);
+        if (map)
+                return map;
+
 	map = alloc_bootmem_node(NODE_DATA(nid),
 			sizeof(struct page) * PAGES_PER_SECTION);
 	if (map)





             reply	other threads:[~2007-05-17  2:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-17  2:40 Zou Nan hai [this message]
2007-05-17 19:32 ` [Patch] Allocate sparsemem memmap above 4G on X86_64 Andrew Morton
2007-05-18  2:52   ` Zou Nan hai
2007-05-18  3:22     ` Andrew Morton

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=1179369607.4103.158.camel@linux-znh \
    --to=nanhai.zou@intel.com \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=suresh.b.siddha@intel.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