]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/suse-2.6.27.39/patches.arch/ppc-pseries-cmm-pagecounter.patch
Add a patch to fix Intel E100 wake-on-lan problems.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.arch / ppc-pseries-cmm-pagecounter.patch
1 Subject: powerpc: Update page in counter for CMM
2 From: Brian King <brking@linux.vnet.ibm.com>
3 References: 445540 - LTC49942
4
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.
11
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>
15
16 ---
17
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(-)
22
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)));
33
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,
39 .slb_count = 64,
40 .vmxregs_in_use = 0,
41 + .page_ins = 0,
42 },
43 };
44
45 --- a/arch/powerpc/mm/fault.c
46 +++ b/arch/powerpc/mm/fault.c
47 @@ -30,6 +30,7 @@
48 #include <linux/kprobes.h>
49 #include <linux/kdebug.h>
50
51 +#include <asm/firmware.h>
52 #include <asm/page.h>
53 #include <asm/pgtable.h>
54 #include <asm/mmu.h>
55 @@ -318,9 +319,16 @@ good_area:
56 goto do_sigbus;
57 BUG();
58 }
59 - if (ret & VM_FAULT_MAJOR)
60 + if (ret & VM_FAULT_MAJOR) {
61 current->maj_flt++;
62 - else
63 +#ifdef CONFIG_PPC_SMLPAR
64 + if (firmware_has_feature(FW_FEATURE_CMO)) {
65 + preempt_disable();
66 + get_lppaca()->page_ins += (1 << PAGE_FACTOR);
67 + preempt_enable();
68 + }
69 +#endif
70 + } else
71 current->min_flt++;
72 up_read(&mm->mmap_sem);
73 return 0;