Skip to contentSkip to conversation

powerpc: VRM unused page hinting

PATCH Superseded Robert Jennings 2 participants 3 messages Apr 14, 2009 – Apr 15, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: VRM unused page hinting

Adds support for the "unused" page hint which can be used in shared memory partitions to flag pages not in use, which will then be stolen before active pages by the hypervisor when memory needs to be moved to LPARs in need of additional memory. Failure to mark pages as 'unused' makes the LPAR slower to give up unused memory to other partitions.

---

 arch/powerpc/include/asm/page.h       |    5 +++
 arch/powerpc/platforms/pseries/lpar.c |   52 ++++++++++++++++++++++++++++++++++
 2 files changed, 57 insertions(+)
arch/powerpc/include/asm/page.h +5 -0
Index: b/arch/powerpc/include/asm/page.h
===================================================================
@@ -231,6 +231,11 @@ extern void copy_user_page(void *to, voi
 		struct page *p);
 extern int page_is_ram(unsigned long pfn);
 
+#ifdef CONFIG_PPC_SMLPAR
+void arch_free_page(struct page *page, int order);
+#define HAVE_ARCH_FREE_PAGE
+#endif
+
 struct vm_area_struct;
 
 typedef struct page *pgtable_t;
arch/powerpc/platforms/pseries/lpar.c +52 -0

55 lines not on this page · raw message

#1 lore raw
Quoted 5 lines · Robert Jennings

Adds support for the "unused" page hint which can be used in shared memory partitions to flag pages not in use, which will then be stolen before active pages by the hypervisor when memory needs to be moved to LPARs in need of additional memory. Failure to mark pages as 'unused' makes the LPAR slower to give up unused memory to other partitions.

The patch also adds a kernel command line option. That should be mentioned in the patch description and documented in Documentation/kernel-parameters.txt. Also, I'd like you to choose a better name for the kernel command line option than "cmma", which is completely opaque to me -- it doesn't seem to be the name or even the initials of anything in the patch. Presumably it's somehow related to CMO, but just how is not at all clear.

Paul.

#2 lore raw

PATCH v2 1/1 powerpc: CMO unused page hinting

In reply to Robert Jennings

Adds support for the "unused" page hint which can be used in shared memory partitions to flag pages not in use, which will then be stolen before active pages by the hypervisor when memory needs to be moved to LPARs in need of additional memory. Failure to mark pages as 'unused' makes the LPAR slower to give up unused memory to other partitions.

This adds the kernel parameter 'cmo_free_hint' to disable this functionality.

---

 Documentation/kernel-parameters.txt   |    7 +++++
 arch/powerpc/include/asm/page.h       |    5 +++
 arch/powerpc/platforms/pseries/lpar.c |   52 ++++++++++++++++++++++++++++++++++
 3 files changed, 64 insertions(+)
Documentation/kernel-parameters.txt +7 -0
Index: b/Documentation/kernel-parameters.txt
===================================================================
@@ -459,6 +459,13 @@ and is between 256 and 4096 characters. 
 			Also note the kernel might malfunction if you disable
 			some critical bits.
 
+	cmo_free_hint=	[PPC] Format: { yes | no }
+			Specify whether pages are marked as being inactive
+			when they are freed.  This is used in CMO environments
+			to determine OS memory pressure for page stealing by
+			a hypervisor.
+			Default: yes
+
 	code_bytes	[IA32/X86_64] How many bytes of object code to print
 			in an oops report.
 			Range: 0 - 8192
arch/powerpc/include/asm/page.h +5 -0
Index: b/arch/powerpc/include/asm/page.h
===================================================================
@@ -231,6 +231,11 @@ extern void copy_user_page(void *to, voi
 		struct page *p);
 extern int page_is_ram(unsigned long pfn);
 
+#ifdef CONFIG_PPC_SMLPAR
+void arch_free_page(struct page *page, int order);
+#define HAVE_ARCH_FREE_PAGE
+#endif
+
 struct vm_area_struct;
 
 typedef struct page *pgtable_t;
arch/powerpc/platforms/pseries/lpar.c +52 -0

55 lines not on this page · raw message