diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2005-07-27 14:45:00 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-07-27 19:26:04 -0400 |
commit | 99b2d8df1d06f1072a949fc1e01a08b94b084d5f (patch) | |
tree | e5be46e9fbee8b68ab1743ef29037c0596a7265f /arch | |
parent | 46ee058cdb3abab9313cc9cb9e9927d7672a718c (diff) |
[PATCH] s390: external call performance
The kernel uses the SIGP external call order code to signal other CPUs. When
running with dedicated CPUs external calls don't get delivered immediately but
within a fixed polling invervall. This can lead to delays where the system
appears to do nothing. Replace the SIGP external call order with the SIGP
emergency call order since this one gets delivered immediately.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/s390/kernel/head.S | 2 | ||||
-rw-r--r-- | arch/s390/kernel/head64.S | 2 | ||||
-rw-r--r-- | arch/s390/kernel/s390_ext.c | 16 | ||||
-rw-r--r-- | arch/s390/kernel/smp.c | 10 |
4 files changed, 17 insertions, 13 deletions
diff --git a/arch/s390/kernel/head.S b/arch/s390/kernel/head.S index fc8bf5e285f6..928ca65e8bb2 100644 --- a/arch/s390/kernel/head.S +++ b/arch/s390/kernel/head.S | |||
@@ -765,7 +765,7 @@ _stext: basr %r13,0 # get base | |||
765 | 765 | ||
766 | # check control registers | 766 | # check control registers |
767 | stctl %c0,%c15,0(%r15) | 767 | stctl %c0,%c15,0(%r15) |
768 | oi 2(%r15),0x20 # enable sigp external interrupts | 768 | oi 2(%r15),0x40 # enable sigp emergency signal |
769 | oi 0(%r15),0x10 # switch on low address protection | 769 | oi 0(%r15),0x10 # switch on low address protection |
770 | lctl %c0,%c15,0(%r15) | 770 | lctl %c0,%c15,0(%r15) |
771 | 771 | ||
diff --git a/arch/s390/kernel/head64.S b/arch/s390/kernel/head64.S index 28c50bdf7d40..10bc592c3637 100644 --- a/arch/s390/kernel/head64.S +++ b/arch/s390/kernel/head64.S | |||
@@ -762,7 +762,7 @@ _stext: basr %r13,0 # get base | |||
762 | 762 | ||
763 | # check control registers | 763 | # check control registers |
764 | stctg %c0,%c15,0(%r15) | 764 | stctg %c0,%c15,0(%r15) |
765 | oi 6(%r15),0x20 # enable sigp external interrupts | 765 | oi 6(%r15),0x40 # enable sigp emergency signal |
766 | oi 4(%r15),0x10 # switch on low address proctection | 766 | oi 4(%r15),0x10 # switch on low address proctection |
767 | lctlg %c0,%c15,0(%r15) | 767 | lctlg %c0,%c15,0(%r15) |
768 | 768 | ||
diff --git a/arch/s390/kernel/s390_ext.c b/arch/s390/kernel/s390_ext.c index 3bdd38ec71da..207bc511a6e3 100644 --- a/arch/s390/kernel/s390_ext.c +++ b/arch/s390/kernel/s390_ext.c | |||
@@ -19,7 +19,6 @@ | |||
19 | #include <asm/irq.h> | 19 | #include <asm/irq.h> |
20 | 20 | ||
21 | /* | 21 | /* |
22 | * Simple hash strategy: index = code & 0xff; | ||
23 | * ext_int_hash[index] is the start of the list for all external interrupts | 22 | * ext_int_hash[index] is the start of the list for all external interrupts |
24 | * that hash to this index. With the current set of external interrupts | 23 | * that hash to this index. With the current set of external interrupts |
25 | * (0x1202 external call, 0x1004 cpu timer, 0x2401 hwc console, 0x4000 | 24 | * (0x1202 external call, 0x1004 cpu timer, 0x2401 hwc console, 0x4000 |
@@ -27,6 +26,11 @@ | |||
27 | */ | 26 | */ |
28 | ext_int_info_t *ext_int_hash[256] = { 0, }; | 27 | ext_int_info_t *ext_int_hash[256] = { 0, }; |
29 | 28 | ||
29 | static inline int ext_hash(__u16 code) | ||
30 | { | ||
31 | return (code + (code >> 9)) & 0xff; | ||
32 | } | ||
33 | |||
30 | int register_external_interrupt(__u16 code, ext_int_handler_t handler) | 34 | int register_external_interrupt(__u16 code, ext_int_handler_t handler) |
31 | { | 35 | { |
32 | ext_int_info_t *p; | 36 | ext_int_info_t *p; |
@@ -37,7 +41,7 @@ int register_external_interrupt(__u16 code, ext_int_handler_t handler) | |||
37 | return -ENOMEM; | 41 | return -ENOMEM; |
38 | p->code = code; | 42 | p->code = code; |
39 | p->handler = handler; | 43 | p->handler = handler; |
40 | index = code & 0xff; | 44 | index = ext_hash(code); |
41 | p->next = ext_int_hash[index]; | 45 | p->next = ext_int_hash[index]; |
42 | ext_int_hash[index] = p; | 46 | ext_int_hash[index] = p; |
43 | return 0; | 47 | return 0; |
@@ -52,7 +56,7 @@ int register_early_external_interrupt(__u16 code, ext_int_handler_t handler, | |||
52 | return -EINVAL; | 56 | return -EINVAL; |
53 | p->code = code; | 57 | p->code = code; |
54 | p->handler = handler; | 58 | p->handler = handler; |
55 | index = code & 0xff; | 59 | index = ext_hash(code); |
56 | p->next = ext_int_hash[index]; | 60 | p->next = ext_int_hash[index]; |
57 | ext_int_hash[index] = p; | 61 | ext_int_hash[index] = p; |
58 | return 0; | 62 | return 0; |
@@ -63,7 +67,7 @@ int unregister_external_interrupt(__u16 code, ext_int_handler_t handler) | |||
63 | ext_int_info_t *p, *q; | 67 | ext_int_info_t *p, *q; |
64 | int index; | 68 | int index; |
65 | 69 | ||
66 | index = code & 0xff; | 70 | index = ext_hash(code); |
67 | q = NULL; | 71 | q = NULL; |
68 | p = ext_int_hash[index]; | 72 | p = ext_int_hash[index]; |
69 | while (p != NULL) { | 73 | while (p != NULL) { |
@@ -90,7 +94,7 @@ int unregister_early_external_interrupt(__u16 code, ext_int_handler_t handler, | |||
90 | 94 | ||
91 | if (p == NULL || p->code != code || p->handler != handler) | 95 | if (p == NULL || p->code != code || p->handler != handler) |
92 | return -EINVAL; | 96 | return -EINVAL; |
93 | index = code & 0xff; | 97 | index = ext_hash(code); |
94 | q = ext_int_hash[index]; | 98 | q = ext_int_hash[index]; |
95 | if (p != q) { | 99 | if (p != q) { |
96 | while (q != NULL) { | 100 | while (q != NULL) { |
@@ -120,7 +124,7 @@ void do_extint(struct pt_regs *regs, unsigned short code) | |||
120 | */ | 124 | */ |
121 | account_ticks(regs); | 125 | account_ticks(regs); |
122 | kstat_cpu(smp_processor_id()).irqs[EXTERNAL_INTERRUPT]++; | 126 | kstat_cpu(smp_processor_id()).irqs[EXTERNAL_INTERRUPT]++; |
123 | index = code & 0xff; | 127 | index = ext_hash(code); |
124 | for (p = ext_int_hash[index]; p; p = p->next) { | 128 | for (p = ext_int_hash[index]; p; p = p->next) { |
125 | if (likely(p->code == code)) { | 129 | if (likely(p->code == code)) { |
126 | if (likely(p->handler)) | 130 | if (likely(p->handler)) |
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index 642572a8e334..da77f001af8d 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c | |||
@@ -375,7 +375,7 @@ static void smp_ext_bitcall(int cpu, ec_bit_sig sig) | |||
375 | * Set signaling bit in lowcore of target cpu and kick it | 375 | * Set signaling bit in lowcore of target cpu and kick it |
376 | */ | 376 | */ |
377 | set_bit(sig, (unsigned long *) &lowcore_ptr[cpu]->ext_call_fast); | 377 | set_bit(sig, (unsigned long *) &lowcore_ptr[cpu]->ext_call_fast); |
378 | while(signal_processor(cpu, sigp_external_call) == sigp_busy) | 378 | while(signal_processor(cpu, sigp_emergency_signal) == sigp_busy) |
379 | udelay(10); | 379 | udelay(10); |
380 | } | 380 | } |
381 | 381 | ||
@@ -394,7 +394,7 @@ static void smp_ext_bitcall_others(ec_bit_sig sig) | |||
394 | * Set signaling bit in lowcore of target cpu and kick it | 394 | * Set signaling bit in lowcore of target cpu and kick it |
395 | */ | 395 | */ |
396 | set_bit(sig, (unsigned long *) &lowcore_ptr[cpu]->ext_call_fast); | 396 | set_bit(sig, (unsigned long *) &lowcore_ptr[cpu]->ext_call_fast); |
397 | while (signal_processor(cpu, sigp_external_call) == sigp_busy) | 397 | while (signal_processor(cpu, sigp_emergency_signal) == sigp_busy) |
398 | udelay(10); | 398 | udelay(10); |
399 | } | 399 | } |
400 | } | 400 | } |
@@ -751,9 +751,9 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
751 | unsigned int cpu; | 751 | unsigned int cpu; |
752 | int i; | 752 | int i; |
753 | 753 | ||
754 | /* request the 0x1202 external interrupt */ | 754 | /* request the 0x1201 emergency signal external interrupt */ |
755 | if (register_external_interrupt(0x1202, do_ext_call_interrupt) != 0) | 755 | if (register_external_interrupt(0x1201, do_ext_call_interrupt) != 0) |
756 | panic("Couldn't request external interrupt 0x1202"); | 756 | panic("Couldn't request external interrupt 0x1201"); |
757 | smp_check_cpus(max_cpus); | 757 | smp_check_cpus(max_cpus); |
758 | memset(lowcore_ptr,0,sizeof(lowcore_ptr)); | 758 | memset(lowcore_ptr,0,sizeof(lowcore_ptr)); |
759 | /* | 759 | /* |