aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/pseries
diff options
context:
space:
mode:
authorLinas Vepstas <linas@austin.ibm.com>2007-08-09 17:01:50 -0400
committerPaul Mackerras <paulus@samba.org>2007-08-16 21:01:52 -0400
commita4fc3a3cead7f9e00dc0f6e00238b11c030f94cc (patch)
tree94d4b39d51a73970c9eab3a63390b71295adfd87 /arch/powerpc/platforms/pseries
parentf774216d465959a4777ac3de67f33bf75ecd4a76 (diff)
[POWERPC] pseries: Avoid excess rtas_token calls
We don't need to look up the rtas event token once per cpu per second. This avoids some misc device-tree lookups and string ops and so provides some minor performance improvement. Signed-off-by: Linas Vepstas <linas@austin.ibm.com> ---- Revised commit-log message. arch/powerpc/platforms/pseries/rtasd.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms/pseries')
-rw-r--r--arch/powerpc/platforms/pseries/rtasd.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/arch/powerpc/platforms/pseries/rtasd.c b/arch/powerpc/platforms/pseries/rtasd.c
index 9797b10b293..762fe87629f 100644
--- a/arch/powerpc/platforms/pseries/rtasd.c
+++ b/arch/powerpc/platforms/pseries/rtasd.c
@@ -44,10 +44,13 @@ static unsigned long rtas_log_start;
44static unsigned long rtas_log_size; 44static unsigned long rtas_log_size;
45 45
46static int surveillance_timeout = -1; 46static int surveillance_timeout = -1;
47static unsigned int rtas_event_scan_rate;
48static unsigned int rtas_error_log_max; 47static unsigned int rtas_error_log_max;
49static unsigned int rtas_error_log_buffer_max; 48static unsigned int rtas_error_log_buffer_max;
50 49
50/* RTAS service tokens */
51static unsigned int event_scan;
52static unsigned int rtas_event_scan_rate;
53
51static int full_rtas_msgs = 0; 54static int full_rtas_msgs = 0;
52 55
53extern int no_logging; 56extern int no_logging;
@@ -381,7 +384,7 @@ static int get_eventscan_parms(void)
381 return 0; 384 return 0;
382} 385}
383 386
384static void do_event_scan(int event_scan) 387static void do_event_scan(void)
385{ 388{
386 int error; 389 int error;
387 do { 390 do {
@@ -408,7 +411,7 @@ static void do_event_scan_all_cpus(long delay)
408 cpu = first_cpu(cpu_online_map); 411 cpu = first_cpu(cpu_online_map);
409 for (;;) { 412 for (;;) {
410 set_cpus_allowed(current, cpumask_of_cpu(cpu)); 413 set_cpus_allowed(current, cpumask_of_cpu(cpu));
411 do_event_scan(rtas_token("event-scan")); 414 do_event_scan();
412 set_cpus_allowed(current, CPU_MASK_ALL); 415 set_cpus_allowed(current, CPU_MASK_ALL);
413 416
414 /* Drop hotplug lock, and sleep for the specified delay */ 417 /* Drop hotplug lock, and sleep for the specified delay */
@@ -426,12 +429,11 @@ static void do_event_scan_all_cpus(long delay)
426static int rtasd(void *unused) 429static int rtasd(void *unused)
427{ 430{
428 unsigned int err_type; 431 unsigned int err_type;
429 int event_scan = rtas_token("event-scan");
430 int rc; 432 int rc;
431 433
432 daemonize("rtasd"); 434 daemonize("rtasd");
433 435
434 if (event_scan == RTAS_UNKNOWN_SERVICE || get_eventscan_parms() == -1) 436 if (get_eventscan_parms() == -1)
435 goto error; 437 goto error;
436 438
437 rtas_log_buf = vmalloc(rtas_error_log_buffer_max*LOG_NUMBER); 439 rtas_log_buf = vmalloc(rtas_error_log_buffer_max*LOG_NUMBER);
@@ -486,7 +488,8 @@ static int __init rtas_init(void)
486 return 0; 488 return 0;
487 489
488 /* No RTAS */ 490 /* No RTAS */
489 if (rtas_token("event-scan") == RTAS_UNKNOWN_SERVICE) { 491 event_scan = rtas_token("event-scan");
492 if (event_scan == RTAS_UNKNOWN_SERVICE) {
490 printk(KERN_DEBUG "rtasd: no event-scan on system\n"); 493 printk(KERN_DEBUG "rtasd: no event-scan on system\n");
491 return -ENODEV; 494 return -ENODEV;
492 } 495 }