From: Anshuman Khandual <khandual@linux.vnet.ibm.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: aneesh.kumar@linux.vnet.ibm.com, mpe@ellerman.id.au
Subject: [RFC 2/4] powerpc/mm: Add comments to the vmemmap layout
Date: Wed, 17 Feb 2016 17:42:57 +0530 [thread overview]
Message-ID: <1455711179-20357-2-git-send-email-khandual@linux.vnet.ibm.com> (raw)
In-Reply-To: <1455711179-20357-1-git-send-email-khandual@linux.vnet.ibm.com>
Add some explaination to the layout of vmemmap virtual address
space and how physical page mapping is only used for valid PFNs
present at any point on the system.
Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
---
arch/powerpc/include/asm/book3s/64/pgtable.h | 41 ++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)
diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h b/arch/powerpc/include/asm/book3s/64/pgtable.h
index 8d1c41d..9db4a86 100644
--- a/arch/powerpc/include/asm/book3s/64/pgtable.h
+++ b/arch/powerpc/include/asm/book3s/64/pgtable.h
@@ -26,6 +26,47 @@
#define IOREMAP_BASE (PHB_IO_END)
#define IOREMAP_END (KERN_VIRT_START + KERN_VIRT_SIZE)
+/*
+ * Starting address of the virtual address space where all page structs
+ * for the system physical memory are stored under the vmemmap sparse
+ * memory model. All possible struct pages are logically stored in a
+ * sequence in this virtual address space irrespective of the fact
+ * whether any given PFN is valid or even the memory section is valid
+ * or not. During boot and memory hotplug add operation when new memory
+ * sections are added, real physical allocation and hash table bolting
+ * will be performed. This saves precious physical memory when the system
+ * really does not have valid PFNs in some address ranges.
+ *
+ * vmemmap +--------------+
+ * + | page struct +----------+ PFN is valid
+ * | +--------------+ |
+ * | | page struct | | PFN is invalid
+ * | +--------------+ |
+ * | | page struct +------+ |
+ * | +--------------+ | |
+ * | | page struct | | |
+ * | +--------------+ | |
+ * | | page struct | | |
+ * | +--------------+ | |
+ * | | page struct +--+ | |
+ * | +--------------+ | | |
+ * | | page struct | | | | +-------------+
+ * | +--------------+ | | +-----> | PFN |
+ * | | page struct | | | +-------------+
+ * | +--------------+ | +---------> | PFN |
+ * | | page struct | | +-------------+
+ * | +--------------+ +-------------> | PFN |
+ * | | page struct | +-------------+
+ * | +--------------+ +----> | PFN |
+ * | | page struct | | +-------------+
+ * | +--------------+ | Bolted in hash table
+ * | | page struct +-----------+
+ * v +--------------+
+ *
+ * VMEMMAP_BASE (0xf000000000000000) region has a total range of 64TB but
+ * then it uses NR_MEM_SECTIONS * PAGES_PER_SECTION * sizeof(page struct)
+ * amount of virtual memory from it.
+ */
#define vmemmap ((struct page *)VMEMMAP_BASE)
/* Advertise special mapping type for AGP */
--
2.1.0
next prev parent reply other threads:[~2016-02-17 12:14 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-17 12:12 [RFC 1/4] powerpc/mm: Rename variable to reflect start address of a section Anshuman Khandual
2016-02-17 12:12 ` Anshuman Khandual [this message]
2016-02-17 14:49 ` [RFC 2/4] powerpc/mm: Add comments to the vmemmap layout Aneesh Kumar K.V
2016-02-18 14:22 ` Michael Ellerman
2016-02-19 5:15 ` Anshuman Khandual
2016-02-17 12:12 ` [RFC 3/4] powerpc/mm: Rename the vmemmap_backing struct and its elements Anshuman Khandual
2016-02-17 14:52 ` Aneesh Kumar K.V
2016-02-18 14:23 ` Michael Ellerman
2016-02-17 12:12 ` [RFC 4/4] powerpc/mm: Rename global tracker for virtual to physical mapping Anshuman Khandual
2016-02-18 14:37 ` Michael Ellerman
2016-02-19 4:54 ` Anshuman Khandual
2016-02-19 10:30 ` Michael Ellerman
2016-02-19 11:02 ` Anshuman Khandual
2016-02-18 14:34 ` [RFC 1/4] powerpc/mm: Rename variable to reflect start address of a section Michael Ellerman
2016-02-19 4:50 ` Anshuman Khandual
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=1455711179-20357-2-git-send-email-khandual@linux.vnet.ibm.com \
--to=khandual@linux.vnet.ibm.com \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
/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).