1 Subject: powerpc: Update page in counter for CMM
2 From: Brian King <brking@linux.vnet.ibm.com>
3 References: 445540 - LTC49942
5 A new field has been added to the VPA as a method for
6 the client OS to communicate to firmware the number of
7 page ins it is performing when running collaborative
8 memory overcommit. The hypervisor will use this information
9 to better determine if a partition is experiencing memory
10 pressure and needs more memory allocated to it.
12 Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
13 Signed-off-by: Robert Jennings <rcjenn@linux.vnet.ibm.com>
14 Signed-off-by: Olaf Hering <olh@suse.de>
18 arch/powerpc/include/asm/lppaca.h | 3 ++-
19 arch/powerpc/kernel/paca.c | 1 +
20 arch/powerpc/mm/fault.c | 12 ++++++++++--
21 3 files changed, 13 insertions(+), 3 deletions(-)
23 --- a/arch/powerpc/include/asm/lppaca.h
24 +++ b/arch/powerpc/include/asm/lppaca.h
25 @@ -133,7 +133,8 @@ struct lppaca {
26 //=============================================================================
27 // CACHE_LINE_4-5 0x0180 - 0x027F Contains PMC interrupt data
28 //=============================================================================
29 - u8 pmc_save_area[256]; // PMC interrupt Area x00-xFF
30 + u32 page_ins; // CMO Hint - # page ins by OS x00-x04
31 + u8 pmc_save_area[252]; // PMC interrupt Area x04-xFF
32 } __attribute__((__aligned__(0x400)));
34 extern struct lppaca lppaca[];
35 --- a/arch/powerpc/kernel/paca.c
36 +++ b/arch/powerpc/kernel/paca.c
37 @@ -36,6 +36,7 @@ struct lppaca lppaca[] = {
38 .end_of_quantum = 0xfffffffffffffffful,
45 --- a/arch/powerpc/mm/fault.c
46 +++ b/arch/powerpc/mm/fault.c
48 #include <linux/kprobes.h>
49 #include <linux/kdebug.h>
51 +#include <asm/firmware.h>
53 #include <asm/pgtable.h>
55 @@ -318,9 +319,16 @@ good_area:
59 - if (ret & VM_FAULT_MAJOR)
60 + if (ret & VM_FAULT_MAJOR) {
63 +#ifdef CONFIG_PPC_SMLPAR
64 + if (firmware_has_feature(FW_FEATURE_CMO)) {
66 + get_lppaca()->page_ins += (1 << PAGE_FACTOR);
72 up_read(&mm->mmap_sem);