linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/11] Generic smp_call_function() #2
@ 2008-04-22 18:50 Jens Axboe
  2008-04-22 18:50 ` Jens Axboe
       [not found] ` <1208890227-24808-1-git-send-email-jens.axboe-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
  0 siblings, 2 replies; 112+ messages in thread
From: Jens Axboe @ 2008-04-22 18:50 UTC (permalink / raw)
  To: linux-arch-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, npiggin-l3A5Bk7waGM,
	torvalds-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b
  Cc: peterz-wEGCiKHe2LqWVfeAwA7xHQ, sam-uyr5N9Q2VtJg9hUCZPvPmw

Hi,

OK, so here's version #2 of the patchset. Changes since the last
posting:

- Better Kconfig setup, thanks Sam.
- Fix data leak, thanks Linus.
- Misplaced sparc64 bit in the s390 patch, thanks Martin.
- Arm should work, thanks Catalin.

-- 
Jens Axboe

^ permalink raw reply	[flat|nested] 112+ messages in thread
* [PATCH 0/11] Generic smp_call_function() and friends
@ 2008-04-22  7:57 Jens Axboe
       [not found] ` <1208851058-8500-1-git-send-email-jens.axboe-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 112+ messages in thread
From: Jens Axboe @ 2008-04-22  7:57 UTC (permalink / raw)
  To: linux-arch-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: npiggin-l3A5Bk7waGM, torvalds-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b

Hi,

While working on the more scalable and faster
smp_call_function_single(), the amount of arch duplicated code in there
botherered me. So I started adding a generic kernel/smp.c helper that
the archs could use instead.

Arch code exports two helper functions:

arch_send_call_function_single_ipi(cpu)
	Send call function single ipi to given cpu
arch_send_call_function_ipi(cpumask)
	Send call function ipi to cpus in cpumask

and then use the generic ipi interrupt helpers to execute the code. I
converted most of the archs capable of SMP, I think only sparc and
sparc64 are still missing. Archs set CONFIG_GENERIC_SMP_HELPERS if they
wish to use the generic helpers for this.

The end result is that we have unified code for handling ipi for
function calls. Even with adding special handling for the single cpu
function call, the diffstat is pretty nice (see below.

There are a couple of changes that affect all archs, and changes that
affect some archs:

- smp_call_function() and friends used to wait for all other CPUs to see
  the individual structure before returning, even if 'wait' wasn't set.
  Not sure what the reasoning behind this was, the new code does not
  wait for other CPUs to start up before returning. If 'wait' is 1,
  it'll wait for completion as before of course. This affects all archs.
  It's easy enough to add if there's a good reason, it'll slow it down a
  little and add an atomic_t to the call_single_data structure.

- A few archs had timeout code, most did not. I removed the timeout
  code, we can add it back if requested.

- The ipi_lock is a little muddy, which may or may not break cpu
  onlining.

In general the new code should be easier to maintain, and it is much
faster than before. The code works fine on x86, x86-64, ia64, and
powerpc. Other archs have been compiled whenever possible, some have
not. Each arch patch should contain a note saying what the status of it
is.

 arch/alpha/Kconfig                         |    5 
 arch/alpha/kernel/core_marvel.c            |    6 
 arch/alpha/kernel/smp.c                    |  170 ---------
 arch/arm/Kconfig                           |    5 
 arch/arm/kernel/smp.c                      |  148 --------
 arch/ia64/Kconfig                          |    5 
 arch/ia64/kernel/smp.c                     |  239 -------------
 arch/m32r/Kconfig                          |    5 
 arch/m32r/kernel/smp.c                     |  128 -------
 arch/m32r/kernel/traps.c                   |    3 
 arch/mips/Kconfig                          |    5 
 arch/mips/kernel/smp-mt.c                  |   27 +
 arch/mips/kernel/smp.c                     |  133 -------
 arch/mips/kernel/smtc.c                    |    7 
 arch/mips/sibyte/bcm1480/smp.c             |    3 
 arch/mips/sibyte/sb1250/smp.c              |    2 
 arch/parisc/Kconfig                        |    5 
 arch/parisc/kernel/smp.c                   |  134 +------
 arch/powerpc/Kconfig                       |    5 
 arch/powerpc/kernel/smp.c                  |  220 ------------
 arch/powerpc/platforms/cell/interrupt.c    |    1 
 arch/powerpc/platforms/ps3/smp.c           |    7 
 arch/powerpc/platforms/pseries/xics.c      |    6 
 arch/powerpc/sysdev/mpic.c                 |    2 
 arch/s390/Kconfig                          |    5 
 arch/s390/kernel/smp.c                     |  160 ---------
 arch/sh/Kconfig                            |    5 
 arch/sh/kernel/smp.c                       |   48 --
 arch/sparc64/kernel/sparc64_ksyms.c        |    1 
 arch/x86/Kconfig                           |    5 
 arch/x86/kernel/apic_32.c                  |    4 
 arch/x86/kernel/entry_64.S                 |    3 
 arch/x86/kernel/i8259_64.c                 |    4 
 arch/x86/kernel/smp.c                      |  148 +-------
 arch/x86/kernel/smpcommon.c                |   56 ---
 arch/x86/mach-voyager/voyager_smp.c        |   91 -----
 arch/x86/xen/enlighten.c                   |    1 
 arch/x86/xen/mmu.c                         |    2 
 arch/x86/xen/smp.c                         |  108 +-----
 include/asm-alpha/smp.h                    |    2 
 include/asm-ia64/smp.h                     |    3 
 include/asm-m32r/smp.h                     |    1 
 include/asm-mips/smp.h                     |   12 
 include/asm-powerpc/smp.h                  |    5 
 include/asm-s390/sigp.h                    |    1 
 include/asm-s390/smp.h                     |    2 
 include/asm-sh/smp.h                       |   12 
 include/asm-x86/hw_irq_32.h                |    1 
 include/asm-x86/hw_irq_64.h                |    2 
 include/asm-x86/mach-default/entry_arch.h  |    1 
 include/asm-x86/mach-default/irq_vectors.h |    1 
 include/asm-x86/mach-voyager/entry_arch.h  |    2 
 include/asm-x86/mach-voyager/irq_vectors.h |    4 
 include/asm-x86/smp.h                      |   10 
 include/linux/smp.h                        |   27 +
 init/main.c                                |    3 
 kernel/Makefile                            |    1 
 kernel/smp.c                               |  366 +++++++++++++++++++++
 58 files changed, 694 insertions(+), 1674 deletions(-)

-- 
Jens Axboe

^ permalink raw reply	[flat|nested] 112+ messages in thread

end of thread, other threads:[~2008-04-28 14:49 UTC | newest]

Thread overview: 112+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-22 18:50 [PATCH 0/11] Generic smp_call_function() #2 Jens Axboe
2008-04-22 18:50 ` Jens Axboe
     [not found] ` <1208890227-24808-1-git-send-email-jens.axboe-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2008-04-22 18:50   ` [PATCH 1/11] Add generic helpers for arch IPI function calls Jens Axboe
2008-04-22 18:50     ` Jens Axboe
     [not found]     ` <1208890227-24808-2-git-send-email-jens.axboe-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2008-04-22 20:17       ` Peter Zijlstra
2008-04-22 20:17         ` Peter Zijlstra
2008-04-23  6:07         ` Jens Axboe
2008-04-23  6:07           ` Jens Axboe
     [not found]           ` <20080423060725.GT12774-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org>
2008-04-23  6:32             ` Peter Zijlstra
2008-04-23  6:32               ` Peter Zijlstra
2008-04-23  7:49               ` Jens Axboe
2008-04-23  7:49                 ` Jens Axboe
     [not found]                 ` <20080423074933.GB12774-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org>
2008-04-23  7:50                   ` Peter Zijlstra
2008-04-23  7:50                     ` Peter Zijlstra
2008-04-24 22:01       ` Russell King
2008-04-24 22:01         ` Russell King
     [not found]         ` <20080424220157.GA26179-f404yB8NqCZvn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2008-04-25  7:18           ` Jens Axboe
2008-04-25  7:18             ` Jens Axboe
     [not found]             ` <20080425071823.GF12774-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org>
2008-04-26  6:28               ` Jeremy Fitzhardinge
2008-04-26  6:28                 ` Jeremy Fitzhardinge
     [not found]                 ` <4812CB99.1070600-TSDbQ3PG+2Y@public.gmane.org>
2008-04-28  7:38                   ` Jes Sorensen
2008-04-28  7:38                     ` Jes Sorensen
2008-04-26  6:11       ` Andrew Morton
2008-04-26  6:11         ` Andrew Morton
     [not found]         ` <20080425231100.b93a1601.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2008-04-26 14:13           ` James Bottomley
2008-04-26 14:13             ` James Bottomley
2008-04-27  0:58           ` Paul E. McKenney
2008-04-27  0:58             ` Paul E. McKenney
     [not found]             ` <20080427005816.GB21687-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2008-04-27 10:36               ` Jens Axboe
2008-04-27 10:36                 ` Jens Axboe
2008-04-27 10:30           ` Jens Axboe
2008-04-27 10:30             ` Jens Axboe
     [not found]         ` <1209219236.3113.6.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2008-04-28 14:25           ` David Howells
2008-04-28 14:25             ` David Howells
     [not found]             ` <18470.1209392727-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2008-04-28 14:43               ` James Bottomley
2008-04-28 14:43                 ` James Bottomley
2008-04-22 18:50   ` [PATCH 2/11] x86: convert to generic helpers for " Jens Axboe
2008-04-22 18:50     ` Jens Axboe
2008-04-22 19:03     ` Linus Torvalds
2008-04-22 19:03       ` Linus Torvalds
     [not found]       ` <alpine.LFD.1.10.0804221157220.2779-5CScLwifNT1QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>
2008-04-22 19:12         ` Ingo Molnar
2008-04-22 19:12           ` Ingo Molnar
     [not found]           ` <20080422191213.GA6370-X9Un+BFzKDI@public.gmane.org>
2008-04-22 19:22             ` Linus Torvalds
2008-04-22 19:22               ` Linus Torvalds
2008-04-22 19:26               ` Ingo Molnar
2008-04-22 19:26                 ` Ingo Molnar
     [not found]                 ` <20080422192601.GB12588-X9Un+BFzKDI@public.gmane.org>
2008-04-22 19:50                   ` Linus Torvalds
2008-04-22 19:50                     ` Linus Torvalds
     [not found]                     ` <alpine.LFD.1.10.0804221244350.2779-5CScLwifNT1QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>
2008-04-23  1:11                       ` Nick Piggin
2008-04-23  1:11                         ` Nick Piggin
     [not found]                         ` <20080423011153.GB17572-B4tOwbsTzaBolqkO4TVVkw@public.gmane.org>
2008-04-23  1:22                           ` Linus Torvalds
2008-04-23  1:22                             ` Linus Torvalds
     [not found]                             ` <alpine.LFD.1.10.0804221817050.2779-5CScLwifNT1QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>
2008-04-23  1:36                               ` Nick Piggin
2008-04-23  1:36                                 ` Nick Piggin
2008-04-23  7:08                           ` Jens Axboe
2008-04-23  7:08                             ` Jens Axboe
2008-04-23 12:54         ` Jens Axboe
2008-04-23 12:54           ` Jens Axboe
     [not found]     ` <1208890227-24808-3-git-send-email-jens.axboe-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2008-04-26  6:44       ` Jeremy Fitzhardinge
2008-04-26  6:44         ` Jeremy Fitzhardinge
     [not found]         ` <4812CF5B.4080902-TSDbQ3PG+2Y@public.gmane.org>
2008-04-27 10:23           ` Jens Axboe
2008-04-27 10:23             ` Jens Axboe
     [not found]             ` <20080427102335.GS12774-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org>
2008-04-27 15:18               ` Jeremy Fitzhardinge
2008-04-27 15:18                 ` Jeremy Fitzhardinge
2008-04-22 18:50   ` [PATCH 3/11] powerpc: " Jens Axboe
2008-04-22 18:50     ` Jens Axboe
2008-04-22 18:50   ` [PATCH 4/11] ia64: " Jens Axboe
2008-04-22 18:50     ` Jens Axboe
2008-04-22 18:50   ` [PATCH 5/11] alpha: " Jens Axboe
2008-04-22 18:50     ` Jens Axboe
2008-04-22 18:50   ` [PATCH 6/11] arm: " Jens Axboe
2008-04-22 18:50     ` Jens Axboe
2008-04-22 18:50   ` [PATCH 7/11] m32r: " Jens Axboe
2008-04-22 18:50     ` Jens Axboe
2008-04-22 18:50   ` [PATCH 8/11] mips: " Jens Axboe
2008-04-22 18:50     ` Jens Axboe
2008-04-22 23:18     ` Ralf Baechle
2008-04-22 23:18       ` Ralf Baechle
2008-04-23  7:18       ` Jens Axboe
2008-04-23  7:18         ` Jens Axboe
2008-04-22 18:50   ` [PATCH 9/11] parisc: " Jens Axboe
2008-04-22 18:50     ` Jens Axboe
2008-04-22 18:50   ` [PATCH 10/11] sh: " Jens Axboe
2008-04-22 18:50     ` Jens Axboe
     [not found]     ` <1208890227-24808-11-git-send-email-jens.axboe-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2008-04-25  8:56       ` Paul Mundt
2008-04-25  8:56         ` Paul Mundt
     [not found]         ` <20080425085637.GA30569-M7jkjyW5wf5g9hUCZPvPmw@public.gmane.org>
2008-04-25  9:16           ` Jens Axboe
2008-04-25  9:16             ` Jens Axboe
2008-04-22 18:50   ` [PATCH 11/11] s390: " Jens Axboe
2008-04-22 18:50     ` Jens Axboe
     [not found]     ` <1208890227-24808-12-git-send-email-jens.axboe-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2008-04-23  7:58       ` Heiko Carstens
2008-04-23  7:58         ` Heiko Carstens
     [not found]         ` <20080423075831.GB15850-Pmgahw53EmNLmI7Nx2oIsGnsbthNF6/HVpNB7YpNyf8@public.gmane.org>
2008-04-23  8:11           ` Jens Axboe
2008-04-23  8:11             ` Jens Axboe
     [not found]             ` <20080423081147.GC12774-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org>
2008-04-23 11:21               ` Jens Axboe
2008-04-23 11:21                 ` Jens Axboe
     [not found]                 ` <20080423112124.GJ12774-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org>
2008-04-23 11:47                   ` Heiko Carstens
2008-04-23 11:47                     ` Heiko Carstens
     [not found]                     ` <20080423114744.GA29422-Pmgahw53EmNLmI7Nx2oIsGnsbthNF6/HVpNB7YpNyf8@public.gmane.org>
2008-04-23 11:54                       ` Jens Axboe
2008-04-23 11:54                         ` Jens Axboe
2008-04-23 12:42                       ` Martin Schwidefsky
2008-04-23 12:42                         ` Martin Schwidefsky
2008-04-23 15:56                         ` Rusty Russell
2008-04-23 15:56                           ` Rusty Russell
  -- strict thread matches above, loose matches on Subject: below --
2008-04-22  7:57 [PATCH 0/11] Generic smp_call_function() and friends Jens Axboe
     [not found] ` <1208851058-8500-1-git-send-email-jens.axboe-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2008-04-22  7:57   ` [PATCH 11/11] s390: convert to generic helpers for IPI function calls Jens Axboe
2008-04-22  7:57     ` Jens Axboe
     [not found]     ` <1208851058-8500-12-git-send-email-jens.axboe-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2008-04-22  8:04       ` Martin Schwidefsky
2008-04-22  8:04         ` Martin Schwidefsky
2008-04-22  8:07         ` Jens Axboe
2008-04-22  8:07           ` Jens Axboe
2008-04-22  7:57   ` Jens Axboe
2008-04-22  7:57     ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).