From: Jon Tollefson <kniht@linux.vnet.ibm.com>
To: linux-kernel@vger.kernel.org,
Linux Memory Management List <linux-mm@kvack.org>,
linuxppc-dev <linuxppc-dev@ozlabs.org>
Cc: Paul Mackerras <paulus@samba.org>,
Andi Kleen <andi@firstfloor.org>,
Adam Litke <agl@linux.vnet.ibm.com>
Subject: [PATCH 2/4] powerpc: function for allocating gigantic pages
Date: Wed, 26 Mar 2008 16:26:13 -0500 [thread overview]
Message-ID: <47EABF75.9090605@linux.vnet.ibm.com> (raw)
In-Reply-To: <47EABE2D.7080400@linux.vnet.ibm.com>
The 16G page locations have been saved during early boot in an array. The
alloc_bm_huge_page() function adds a page from here to the huge_boot_pages list.
Signed-off-by: Jon Tollefson <kniht@linux.vnet.ibm.com>
---
hugetlbpage.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
index 94625db..31d977b 100644
--- a/arch/powerpc/mm/hugetlbpage.c
+++ b/arch/powerpc/mm/hugetlbpage.c
@@ -29,6 +29,10 @@
#define NUM_LOW_AREAS (0x100000000UL >> SID_SHIFT)
#define NUM_HIGH_AREAS (PGTABLE_RANGE >> HTLB_AREA_SHIFT)
+#define MAX_NUMBER_GPAGES 1024
+
+static void *gpage_freearray[MAX_NUMBER_GPAGES];
+static unsigned nr_gpages;
unsigned int hugepte_shift;
#define PTRS_PER_HUGEPTE (1 << hugepte_shift)
@@ -104,6 +108,21 @@ pmd_t *hpmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long addr)
}
#endif
+/* Put 16G page address into temporary huge page list because the mem_map
+ * is not up yet.
+ */
+int alloc_bm_huge_page(struct hstate *h)
+{
+ struct huge_bm_page *m;
+ if (nr_gpages == 0)
+ return 0;
+ m = gpage_freearray[--nr_gpages];
+ list_add(&m->list, &huge_boot_pages);
+ m->hstate = h;
+ return 1;
+}
+
+
/* Modelled after find_linux_pte() */
pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr)
{
next prev parent reply other threads:[~2008-03-26 21:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-26 21:20 [PATCH 0/4] 16G huge page support for powerpc Jon Tollefson
2008-03-26 21:24 ` [PATCH 1/4] allow arch specific function for allocating gigantic pages Jon Tollefson
2008-03-26 21:49 ` Andi Kleen
2008-03-26 21:26 ` Jon Tollefson [this message]
2008-03-26 21:27 ` [PATCH 3/4] powerpc: scan device tree and save gigantic page locations Jon Tollefson
2008-03-26 21:29 ` [PATCH 4/4] powerpc: define page support for 16G pages Jon Tollefson
2008-03-26 21:47 ` [PATCH 0/4] 16G huge page support for powerpc Andi Kleen
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=47EABF75.9090605@linux.vnet.ibm.com \
--to=kniht@linux.vnet.ibm.com \
--cc=agl@linux.vnet.ibm.com \
--cc=andi@firstfloor.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.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;
as well as URLs for NNTP newsgroup(s).