diff options
author | Fenghua Yu <fenghua.yu@intel.com> | 2008-03-14 16:57:08 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2008-04-04 14:06:38 -0400 |
commit | a6c75b86ce9f01db4ea9912877b526c2dc4d2f0a (patch) | |
tree | a8763d9be28ffff5d28f1ff3235f044aaa64a0fa | |
parent | 2046b94e7c4fce92eb8165c2c36c6478f4927178 (diff) |
[IA64] Kernel parameter for max number of concurrent global TLB purges
The patch defines kernel parameter "nptcg=". The parameter overrides max number
of concurrent global TLB purges which is reported from either PAL_VM_SUMMARY or
SAL PALO.
Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
-rw-r--r-- | Documentation/kernel-parameters.txt | 4 | ||||
-rw-r--r-- | arch/ia64/kernel/efi.c | 2 | ||||
-rw-r--r-- | arch/ia64/kernel/setup.c | 2 | ||||
-rw-r--r-- | arch/ia64/mm/tlb.c | 46 | ||||
-rw-r--r-- | include/asm-ia64/sal.h | 4 |
5 files changed, 51 insertions, 7 deletions
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 4cd1a5da80a4..be92e6165722 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -1335,6 +1335,10 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1335 | 1335 | ||
1336 | nowb [ARM] | 1336 | nowb [ARM] |
1337 | 1337 | ||
1338 | nptcg= [IA64] Override max number of concurrent global TLB | ||
1339 | purges which is reported from either PAL_VM_SUMMARY or | ||
1340 | SAL PALO. | ||
1341 | |||
1338 | numa_zonelist_order= [KNL, BOOT] Select zonelist order for NUMA. | 1342 | numa_zonelist_order= [KNL, BOOT] Select zonelist order for NUMA. |
1339 | one of ['zone', 'node', 'default'] can be specified | 1343 | one of ['zone', 'node', 'default'] can be specified |
1340 | This can be set from sysctl after boot. | 1344 | This can be set from sysctl after boot. |
diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c index 003cd09b0732..d45f215bc8fc 100644 --- a/arch/ia64/kernel/efi.c +++ b/arch/ia64/kernel/efi.c | |||
@@ -436,7 +436,7 @@ static void __init handle_palo(unsigned long palo_phys) | |||
436 | return; | 436 | return; |
437 | } | 437 | } |
438 | 438 | ||
439 | setup_ptcg_sem(palo->max_tlb_purges, 1); | 439 | setup_ptcg_sem(palo->max_tlb_purges, NPTCG_FROM_PALO); |
440 | } | 440 | } |
441 | 441 | ||
442 | void | 442 | void |
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c index 1cbd26340d87..f798c0769d36 100644 --- a/arch/ia64/kernel/setup.c +++ b/arch/ia64/kernel/setup.c | |||
@@ -949,7 +949,7 @@ cpu_init (void) | |||
949 | /* set ia64_ctx.max_rid to the maximum RID that is supported by all CPUs: */ | 949 | /* set ia64_ctx.max_rid to the maximum RID that is supported by all CPUs: */ |
950 | if (ia64_pal_vm_summary(NULL, &vmi) == 0) { | 950 | if (ia64_pal_vm_summary(NULL, &vmi) == 0) { |
951 | max_ctx = (1U << (vmi.pal_vm_info_2_s.rid_size - 3)) - 1; | 951 | max_ctx = (1U << (vmi.pal_vm_info_2_s.rid_size - 3)) - 1; |
952 | setup_ptcg_sem(vmi.pal_vm_info_2_s.max_purges, 0); | 952 | setup_ptcg_sem(vmi.pal_vm_info_2_s.max_purges, NPTCG_FROM_PAL); |
953 | } else { | 953 | } else { |
954 | printk(KERN_WARNING "cpu_init: PAL VM summary failed, assuming 18 RID bits\n"); | 954 | printk(KERN_WARNING "cpu_init: PAL VM summary failed, assuming 18 RID bits\n"); |
955 | max_ctx = (1U << 15) - 1; /* use architected minimum */ | 955 | max_ctx = (1U << 15) - 1; /* use architected minimum */ |
diff --git a/arch/ia64/mm/tlb.c b/arch/ia64/mm/tlb.c index d41d6076ed03..1a8948fd0029 100644 --- a/arch/ia64/mm/tlb.c +++ b/arch/ia64/mm/tlb.c | |||
@@ -120,19 +120,45 @@ static int need_ptcg_sem = 1; | |||
120 | static int toolatetochangeptcgsem = 0; | 120 | static int toolatetochangeptcgsem = 0; |
121 | 121 | ||
122 | /* | 122 | /* |
123 | * Kernel parameter "nptcg=" overrides max number of concurrent global TLB | ||
124 | * purges which is reported from either PAL or SAL PALO. | ||
125 | * | ||
126 | * We don't have sanity checking for nptcg value. It's the user's responsibility | ||
127 | * for valid nptcg value on the platform. Otherwise, kernel may hang in some | ||
128 | * cases. | ||
129 | */ | ||
130 | static int __init | ||
131 | set_nptcg(char *str) | ||
132 | { | ||
133 | int value = 0; | ||
134 | |||
135 | get_option(&str, &value); | ||
136 | setup_ptcg_sem(value, NPTCG_FROM_KERNEL_PARAMETER); | ||
137 | |||
138 | return 1; | ||
139 | } | ||
140 | |||
141 | __setup("nptcg=", set_nptcg); | ||
142 | |||
143 | /* | ||
123 | * Maximum number of simultaneous ptc.g purges in the system can | 144 | * Maximum number of simultaneous ptc.g purges in the system can |
124 | * be defined by PAL_VM_SUMMARY (in which case we should take | 145 | * be defined by PAL_VM_SUMMARY (in which case we should take |
125 | * the smallest value for any cpu in the system) or by the PAL | 146 | * the smallest value for any cpu in the system) or by the PAL |
126 | * override table (in which case we should ignore the value from | 147 | * override table (in which case we should ignore the value from |
127 | * PAL_VM_SUMMARY). | 148 | * PAL_VM_SUMMARY). |
128 | * | 149 | * |
150 | * Kernel parameter "nptcg=" overrides maximum number of simultanesous ptc.g | ||
151 | * purges defined in either PAL_VM_SUMMARY or PAL override table. In this case, | ||
152 | * we should ignore the value from either PAL_VM_SUMMARY or PAL override table. | ||
153 | * | ||
129 | * Complicating the logic here is the fact that num_possible_cpus() | 154 | * Complicating the logic here is the fact that num_possible_cpus() |
130 | * isn't fully setup until we start bringing cpus online. | 155 | * isn't fully setup until we start bringing cpus online. |
131 | */ | 156 | */ |
132 | void | 157 | void |
133 | setup_ptcg_sem(int max_purges, int from_palo) | 158 | setup_ptcg_sem(int max_purges, int nptcg_from) |
134 | { | 159 | { |
135 | static int have_palo; | 160 | static int kp_override; |
161 | static int palo_override; | ||
136 | static int firstcpu = 1; | 162 | static int firstcpu = 1; |
137 | 163 | ||
138 | if (toolatetochangeptcgsem) { | 164 | if (toolatetochangeptcgsem) { |
@@ -140,8 +166,18 @@ setup_ptcg_sem(int max_purges, int from_palo) | |||
140 | return; | 166 | return; |
141 | } | 167 | } |
142 | 168 | ||
143 | if (from_palo) { | 169 | if (nptcg_from == NPTCG_FROM_KERNEL_PARAMETER) { |
144 | have_palo = 1; | 170 | kp_override = 1; |
171 | nptcg = max_purges; | ||
172 | goto resetsema; | ||
173 | } | ||
174 | if (kp_override) { | ||
175 | need_ptcg_sem = num_possible_cpus() > nptcg; | ||
176 | return; | ||
177 | } | ||
178 | |||
179 | if (nptcg_from == NPTCG_FROM_PALO) { | ||
180 | palo_override = 1; | ||
145 | 181 | ||
146 | /* In PALO max_purges == 0 really means it! */ | 182 | /* In PALO max_purges == 0 really means it! */ |
147 | if (max_purges == 0) | 183 | if (max_purges == 0) |
@@ -153,7 +189,7 @@ setup_ptcg_sem(int max_purges, int from_palo) | |||
153 | } | 189 | } |
154 | goto resetsema; | 190 | goto resetsema; |
155 | } | 191 | } |
156 | if (have_palo) { | 192 | if (palo_override) { |
157 | if (nptcg != PALO_MAX_TLB_PURGES) | 193 | if (nptcg != PALO_MAX_TLB_PURGES) |
158 | need_ptcg_sem = (num_possible_cpus() > nptcg); | 194 | need_ptcg_sem = (num_possible_cpus() > nptcg); |
159 | return; | 195 | return; |
diff --git a/include/asm-ia64/sal.h b/include/asm-ia64/sal.h index 3cd637a2c051..89594b442f83 100644 --- a/include/asm-ia64/sal.h +++ b/include/asm-ia64/sal.h | |||
@@ -896,6 +896,10 @@ struct palo_table { | |||
896 | u8 reserved2[6]; | 896 | u8 reserved2[6]; |
897 | }; | 897 | }; |
898 | 898 | ||
899 | #define NPTCG_FROM_PAL 0 | ||
900 | #define NPTCG_FROM_PALO 1 | ||
901 | #define NPTCG_FROM_KERNEL_PARAMETER 2 | ||
902 | |||
899 | #endif /* __ASSEMBLY__ */ | 903 | #endif /* __ASSEMBLY__ */ |
900 | 904 | ||
901 | #endif /* _ASM_IA64_SAL_H */ | 905 | #endif /* _ASM_IA64_SAL_H */ |