From: Andy Whitcroft <apw@shadowen.org>
To: Andrew Morton <akpm@linux-foundation.org>,
Christoph Hellwig <hch@infradead.org>
Cc: linux-mm@kvack.org, linux-arch@vger.kernel.org,
Nick Piggin <npiggin@suse.de>,
Christoph Lameter <clameter@sgi.com>, Mel Gorman <mel@csn.ul.ie>,
Andy Whitcroft <apw@shadowen.org>
Subject: [PATCH 2/5] vmemmap x86_64: convert to new helper based initialisation
Date: Fri, 10 Aug 2007 15:40:42 +0100 [thread overview]
Message-ID: <E1IJVfO-0004un-Cw@localhost.localdomain> (raw)
In-Reply-To: exportbomb.1186756801@pinky
Convert over to the new helper initialialisation and Kconfig options.
Signed-off-by: Andy Whitcroft <apw@shadowen.org>
---
arch/x86_64/Kconfig | 9 +--------
arch/x86_64/mm/init.c | 26 ++++++++++++++++++++------
2 files changed, 21 insertions(+), 14 deletions(-)
diff --git a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig
index 9ad7ab4..79a3e3c 100644
--- a/arch/x86_64/Kconfig
+++ b/arch/x86_64/Kconfig
@@ -405,14 +405,7 @@ config ARCH_DISCONTIGMEM_DEFAULT
config ARCH_SPARSEMEM_ENABLE
def_bool y
depends on (NUMA || EXPERIMENTAL)
-
-config SPARSEMEM_VMEMMAP
- def_bool y
- depends on SPARSEMEM
-
-config ARCH_POPULATES_SPARSEMEM_VMEMMAP_PMD
- def_bool y
- depends on SPARSEMEM_VMEMMAP
+ select SPARSEMEM_VMEMMAP_ENABLE
config ARCH_MEMORY_PROBE
def_bool y
diff --git a/arch/x86_64/mm/init.c b/arch/x86_64/mm/init.c
index 5d1ed03..5ac3d76 100644
--- a/arch/x86_64/mm/init.c
+++ b/arch/x86_64/mm/init.c
@@ -784,18 +784,31 @@ const char *arch_vma_name(struct vm_area_struct *vma)
return NULL;
}
-#ifdef CONFIG_ARCH_POPULATES_SPARSEMEM_VMEMMAP_PMD
+#ifdef CONFIG_SPARSEMEM_VMEMMAP
/*
* Initialise the sparsemem vmemmap using huge-pages at the PMD level.
*/
-int __meminit vmemmap_populate_pmd(pud_t *pud, unsigned long addr,
- unsigned long end, int node)
+int __meminit vmemmap_populate(struct page *start_page,
+ unsigned long size, int node)
{
- pmd_t *pmd;
+ unsigned long addr = (unsigned long)start_page;
+ unsigned long end = (unsigned long)(start_page + size);
unsigned long next;
+ pgd_t *pgd;
+ pud_t *pud;
+ pmd_t *pmd;
- for (pmd = pmd_offset(pud, addr); addr < end; pmd++, addr = next) {
+ for (; addr < end; addr = next) {
next = pmd_addr_end(addr, end);
+
+ pgd = vmemmap_pgd_populate(addr, node);
+ if (!pgd)
+ return -ENOMEM;
+ pud = vmemmap_pud_populate(pgd, addr, node);
+ if (!pud)
+ return -ENOMEM;
+
+ pmd = pmd_offset(pud, addr);
if (pmd_none(*pmd)) {
pte_t entry;
void *p = vmemmap_alloc_block(PMD_SIZE, node);
@@ -809,8 +822,9 @@ int __meminit vmemmap_populate_pmd(pud_t *pud, unsigned long addr,
printk(KERN_DEBUG " [%lx-%lx] PMD ->%p on node %d\n",
addr, addr + PMD_SIZE - 1, p, node);
} else
- vmemmap_verify((pte_t *)pmd, node, next, end);
+ vmemmap_verify((pte_t *)pmd, node, addr, next);
}
+
return 0;
}
#endif
next prev parent reply other threads:[~2007-08-10 14:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-10 14:40 [PATCH 0/5] vmemmap updates to V7 Andy Whitcroft
2007-08-10 14:40 ` [PATCH 1/5] vmemmap: generify initialisation via helpers Andy Whitcroft
2007-08-10 17:56 ` Christoph Lameter
2007-08-15 14:54 ` Andy Whitcroft
2007-08-10 14:40 ` Andy Whitcroft [this message]
2007-08-10 14:41 ` [PATCH 3/5] vmemmap ppc64: convert to new config options Andy Whitcroft
2007-08-10 14:41 ` [PATCH 4/5] vmemmap sparc64: " Andy Whitcroft
2007-08-10 14:41 ` [PATCH 5/5] vmemmap ia64: convert to new helper based initialisation Andy Whitcroft
2007-08-10 18:01 ` Christoph Lameter
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=E1IJVfO-0004un-Cw@localhost.localdomain \
--to=apw@shadowen.org \
--cc=akpm@linux-foundation.org \
--cc=clameter@sgi.com \
--cc=hch@infradead.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mel@csn.ul.ie \
--cc=npiggin@suse.de \
/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;
as well as URLs for NNTP newsgroup(s).