aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms
diff options
context:
space:
mode:
authorLinas Vepstas <linas@linas.org>2005-11-03 19:55:25 -0500
committerPaul Mackerras <paulus@samba.org>2006-01-09 23:30:48 -0500
commit257ffc64a6c22621ecb0371b7f10d5b40b74c878 (patch)
tree1166c38a4ddaf2d4d6f1f9dc838b53b0138b09a7 /arch/powerpc/platforms
parent7684b40cb53ba00cc51271f1c42897b776c48fbc (diff)
[PATCH] powerpc: get rid of per_cpu EEH counters
242-eeh-no-percpu-counters.patch Remove per-cpu counters from the EEH code. These statistics counters are incremented at a very low frequency, and the performance gains of per-cpu variables are negligable. By contrast, the counters weren't safe against cpu off/online operations, and its not worth the effort to make them so (other than to turn them into plain globals). Signed-off-by: Linas Vepstas <linas@austin.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org> (cherry picked from be3b5d1be053ccb41e91fa5a6f43ef5db301357d commit)
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r--arch/powerpc/platforms/pseries/eeh.c60
1 files changed, 23 insertions, 37 deletions
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c
index 9e597cb7e659..136365c1f8e1 100644
--- a/arch/powerpc/platforms/pseries/eeh.c
+++ b/arch/powerpc/platforms/pseries/eeh.c
@@ -97,14 +97,14 @@ static DEFINE_SPINLOCK(slot_errbuf_lock);
97static int eeh_error_buf_size; 97static int eeh_error_buf_size;
98 98
99/* System monitoring statistics */ 99/* System monitoring statistics */
100static DEFINE_PER_CPU(unsigned long, no_device); 100static unsigned long no_device;
101static DEFINE_PER_CPU(unsigned long, no_dn); 101static unsigned long no_dn;
102static DEFINE_PER_CPU(unsigned long, no_cfg_addr); 102static unsigned long no_cfg_addr;
103static DEFINE_PER_CPU(unsigned long, ignored_check); 103static unsigned long ignored_check;
104static DEFINE_PER_CPU(unsigned long, total_mmio_ffs); 104static unsigned long total_mmio_ffs;
105static DEFINE_PER_CPU(unsigned long, false_positives); 105static unsigned long false_positives;
106static DEFINE_PER_CPU(unsigned long, ignored_failures); 106static unsigned long ignored_failures;
107static DEFINE_PER_CPU(unsigned long, slot_resets); 107static unsigned long slot_resets;
108 108
109#define IS_BRIDGE(class_code) (((class_code)<<16) == PCI_BASE_CLASS_BRIDGE) 109#define IS_BRIDGE(class_code) (((class_code)<<16) == PCI_BASE_CLASS_BRIDGE)
110 110
@@ -288,13 +288,13 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
288 enum pci_channel_state state; 288 enum pci_channel_state state;
289 int rc = 0; 289 int rc = 0;
290 290
291 __get_cpu_var(total_mmio_ffs)++; 291 total_mmio_ffs++;
292 292
293 if (!eeh_subsystem_enabled) 293 if (!eeh_subsystem_enabled)
294 return 0; 294 return 0;
295 295
296 if (!dn) { 296 if (!dn) {
297 __get_cpu_var(no_dn)++; 297 no_dn++;
298 return 0; 298 return 0;
299 } 299 }
300 pdn = PCI_DN(dn); 300 pdn = PCI_DN(dn);
@@ -302,7 +302,7 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
302 /* Access to IO BARs might get this far and still not want checking. */ 302 /* Access to IO BARs might get this far and still not want checking. */
303 if (!(pdn->eeh_mode & EEH_MODE_SUPPORTED) || 303 if (!(pdn->eeh_mode & EEH_MODE_SUPPORTED) ||
304 pdn->eeh_mode & EEH_MODE_NOCHECK) { 304 pdn->eeh_mode & EEH_MODE_NOCHECK) {
305 __get_cpu_var(ignored_check)++; 305 ignored_check++;
306#ifdef DEBUG 306#ifdef DEBUG
307 printk ("EEH:ignored check (%x) for %s %s\n", 307 printk ("EEH:ignored check (%x) for %s %s\n",
308 pdn->eeh_mode, pci_name (dev), dn->full_name); 308 pdn->eeh_mode, pci_name (dev), dn->full_name);
@@ -311,7 +311,7 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
311 } 311 }
312 312
313 if (!pdn->eeh_config_addr && !pdn->eeh_pe_config_addr) { 313 if (!pdn->eeh_config_addr && !pdn->eeh_pe_config_addr) {
314 __get_cpu_var(no_cfg_addr)++; 314 no_cfg_addr++;
315 return 0; 315 return 0;
316 } 316 }
317 317
@@ -353,7 +353,7 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
353 if (ret != 0) { 353 if (ret != 0) {
354 printk(KERN_WARNING "EEH: read_slot_reset_state() failed; rc=%d dn=%s\n", 354 printk(KERN_WARNING "EEH: read_slot_reset_state() failed; rc=%d dn=%s\n",
355 ret, dn->full_name); 355 ret, dn->full_name);
356 __get_cpu_var(false_positives)++; 356 false_positives++;
357 rc = 0; 357 rc = 0;
358 goto dn_unlock; 358 goto dn_unlock;
359 } 359 }
@@ -362,14 +362,14 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
362 if (rets[1] != 1) { 362 if (rets[1] != 1) {
363 printk(KERN_WARNING "EEH: event on unsupported device, rc=%d dn=%s\n", 363 printk(KERN_WARNING "EEH: event on unsupported device, rc=%d dn=%s\n",
364 ret, dn->full_name); 364 ret, dn->full_name);
365 __get_cpu_var(false_positives)++; 365 false_positives++;
366 rc = 0; 366 rc = 0;
367 goto dn_unlock; 367 goto dn_unlock;
368 } 368 }
369 369
370 /* If not the kind of error we know about, punt. */ 370 /* If not the kind of error we know about, punt. */
371 if (rets[0] != 2 && rets[0] != 4 && rets[0] != 5) { 371 if (rets[0] != 2 && rets[0] != 4 && rets[0] != 5) {
372 __get_cpu_var(false_positives)++; 372 false_positives++;
373 rc = 0; 373 rc = 0;
374 goto dn_unlock; 374 goto dn_unlock;
375 } 375 }
@@ -377,12 +377,12 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
377 /* Note that config-io to empty slots may fail; 377 /* Note that config-io to empty slots may fail;
378 * we recognize empty because they don't have children. */ 378 * we recognize empty because they don't have children. */
379 if ((rets[0] == 5) && (dn->child == NULL)) { 379 if ((rets[0] == 5) && (dn->child == NULL)) {
380 __get_cpu_var(false_positives)++; 380 false_positives++;
381 rc = 0; 381 rc = 0;
382 goto dn_unlock; 382 goto dn_unlock;
383 } 383 }
384 384
385 __get_cpu_var(slot_resets)++; 385 slot_resets++;
386 386
387 /* Avoid repeated reports of this failure, including problems 387 /* Avoid repeated reports of this failure, including problems
388 * with other functions on this device, and functions under 388 * with other functions on this device, and functions under
@@ -432,7 +432,7 @@ unsigned long eeh_check_failure(const volatile void __iomem *token, unsigned lon
432 addr = eeh_token_to_phys((unsigned long __force) token); 432 addr = eeh_token_to_phys((unsigned long __force) token);
433 dev = pci_get_device_by_addr(addr); 433 dev = pci_get_device_by_addr(addr);
434 if (!dev) { 434 if (!dev) {
435 __get_cpu_var(no_device)++; 435 no_device++;
436 return val; 436 return val;
437 } 437 }
438 438
@@ -963,25 +963,9 @@ EXPORT_SYMBOL_GPL(eeh_remove_bus_device);
963 963
964static int proc_eeh_show(struct seq_file *m, void *v) 964static int proc_eeh_show(struct seq_file *m, void *v)
965{ 965{
966 unsigned int cpu;
967 unsigned long ffs = 0, positives = 0, failures = 0;
968 unsigned long resets = 0;
969 unsigned long no_dev = 0, no_dn = 0, no_cfg = 0, no_check = 0;
970
971 for_each_cpu(cpu) {
972 ffs += per_cpu(total_mmio_ffs, cpu);
973 positives += per_cpu(false_positives, cpu);
974 failures += per_cpu(ignored_failures, cpu);
975 resets += per_cpu(slot_resets, cpu);
976 no_dev += per_cpu(no_device, cpu);
977 no_dn += per_cpu(no_dn, cpu);
978 no_cfg += per_cpu(no_cfg_addr, cpu);
979 no_check += per_cpu(ignored_check, cpu);
980 }
981
982 if (0 == eeh_subsystem_enabled) { 966 if (0 == eeh_subsystem_enabled) {
983 seq_printf(m, "EEH Subsystem is globally disabled\n"); 967 seq_printf(m, "EEH Subsystem is globally disabled\n");
984 seq_printf(m, "eeh_total_mmio_ffs=%ld\n", ffs); 968 seq_printf(m, "eeh_total_mmio_ffs=%ld\n", total_mmio_ffs);
985 } else { 969 } else {
986 seq_printf(m, "EEH Subsystem is enabled\n"); 970 seq_printf(m, "EEH Subsystem is enabled\n");
987 seq_printf(m, 971 seq_printf(m,
@@ -993,8 +977,10 @@ static int proc_eeh_show(struct seq_file *m, void *v)
993 "eeh_false_positives=%ld\n" 977 "eeh_false_positives=%ld\n"
994 "eeh_ignored_failures=%ld\n" 978 "eeh_ignored_failures=%ld\n"
995 "eeh_slot_resets=%ld\n", 979 "eeh_slot_resets=%ld\n",
996 no_dev, no_dn, no_cfg, no_check, 980 no_device, no_dn, no_cfg_addr,
997 ffs, positives, failures, resets); 981 ignored_check, total_mmio_ffs,
982 false_positives, ignored_failures,
983 slot_resets);
998 } 984 }
999 985
1000 return 0; 986 return 0;