linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/11] Generic smp_call_function() and friends
@ 2008-04-22  7:57 Jens Axboe
  2008-04-22  7:57 ` Jens Axboe
       [not found] ` <1208851058-8500-1-git-send-email-jens.axboe-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
  0 siblings, 2 replies; 161+ 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] 161+ messages in thread
* [PATCH 0/11] Generic smp_call_function() #2
@ 2008-04-22 18:50 Jens Axboe
       [not found] ` <1208890227-24808-1-git-send-email-jens.axboe-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 161+ 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] 161+ messages in thread

end of thread, other threads:[~2008-05-01 16:23 UTC | newest]

Thread overview: 161+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-22  7:57 [PATCH 0/11] Generic smp_call_function() and friends Jens Axboe
2008-04-22  7:57 ` Jens Axboe
     [not found] ` <1208851058-8500-1-git-send-email-jens.axboe-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2008-04-22  7:57   ` [PATCH 1/11] Add generic helpers for arch IPI function calls Jens Axboe
2008-04-22  7:57     ` Jens Axboe
     [not found]     ` <1208851058-8500-2-git-send-email-jens.axboe-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2008-04-22  9:16       ` Avi Kivity
2008-04-22  9:16         ` Avi Kivity
     [not found]         ` <480DACDD.7040108-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2008-04-22  9:22           ` Jens Axboe
2008-04-22  9:22             ` Jens Axboe
     [not found]             ` <20080422092230.GW12774-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org>
2008-04-22 11:14               ` Jens Axboe
2008-04-22 11:14                 ` Jens Axboe
2008-04-22 13:00                 ` Peter Zijlstra
2008-04-22 13:00                   ` Peter Zijlstra
2008-04-22 14:25                   ` Jens Axboe
2008-04-22 14:25                     ` Jens Axboe
     [not found]                     ` <20080422142543.GG12774-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org>
2008-04-22 14:38                       ` Avi Kivity
2008-04-22 14:38                         ` Avi Kivity
     [not found]                         ` <480DF861.6000705-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2008-04-22 14:43                           ` Peter Zijlstra
2008-04-22 14:43                             ` Peter Zijlstra
2008-04-22 14:47                             ` Avi Kivity
2008-04-22 14:47                               ` Avi Kivity
2008-04-22 14:53                         ` Jens Axboe
2008-04-22 14:53                           ` Jens Axboe
2008-04-22 14:43       ` Linus Torvalds
2008-04-22 14:43         ` Linus Torvalds
     [not found]         ` <alpine.LFD.1.10.0804220735350.2779-5CScLwifNT1QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>
2008-04-22 14:51           ` Jens Axboe
2008-04-22 14:51             ` Jens Axboe
2008-04-22 15:01             ` Linus Torvalds
2008-04-22 15:01               ` Linus Torvalds
2008-04-22 16:49               ` Jens Axboe
2008-04-22 16:49                 ` Jens Axboe
     [not found]                 ` <20080422164947.GN12774-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org>
2008-04-22 17:04                   ` Jens Axboe
2008-04-22 17:04                     ` Jens Axboe
     [not found]                     ` <20080422170405.GO12774-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org>
2008-04-22 17:13                       ` Jens Axboe
2008-04-22 17:13                         ` Jens Axboe
     [not found]                         ` <20080422171324.GP12774-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org>
2008-04-22 17:29                           ` Linus Torvalds
2008-04-22 17:29                             ` Linus Torvalds
     [not found]                             ` <alpine.LFD.1.10.0804221027210.2779-5CScLwifNT1QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>
2008-04-22 18:23                               ` Jens Axboe
2008-04-22 18:23                                 ` Jens Axboe
     [not found]                                 ` <20080422182337.GQ12774-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org>
2008-04-22 18:39                                   ` Linus Torvalds
2008-04-22 18:39                                     ` Linus Torvalds
2008-04-22 14:58           ` Linus Torvalds
2008-04-22 14:58             ` Linus Torvalds
     [not found]             ` <alpine.LFD.1.10.0804220749450.2779-5CScLwifNT1QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>
2008-04-22 15:07               ` Jens Axboe
2008-04-22 15:07                 ` Jens Axboe
2008-04-22 23:12       ` Mark Lord
2008-04-22 23:12         ` Mark Lord
     [not found]         ` <480E70ED.3030701-gsilrlXbHYg@public.gmane.org>
2008-04-23  7:24           ` Jens Axboe
2008-04-23  7:24             ` Jens Axboe
     [not found]             ` <20080423072432.GX12774-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org>
2008-04-23 13:42               ` Mark Lord
2008-04-23 13:42                 ` Mark Lord
     [not found]                 ` <480F3CBC.60305-gsilrlXbHYg@public.gmane.org>
2008-04-23 13:51                   ` Jens Axboe
2008-04-23 13:51                     ` Jens Axboe
2008-04-23 14:46                     ` Mark Lord
2008-04-23 14:46                       ` Mark Lord
     [not found]                       ` <480F4BD9.8090003-gsilrlXbHYg@public.gmane.org>
2008-04-24 10:59                         ` Jens Axboe
2008-04-24 10:59                           ` Jens Axboe
     [not found]                           ` <20080424105908.GW12774-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org>
2008-04-24 12:44                             ` Mark Lord
2008-04-24 12:44                               ` Mark Lord
     [not found]                               ` <481080A0.9050804-gsilrlXbHYg@public.gmane.org>
2008-04-24 21:30                                 ` Rafael J. Wysocki
2008-04-24 21:30                                   ` Rafael J. Wysocki
2008-04-25 11:08                                 ` Pavel Machek
2008-04-25 11:08                                   ` Pavel Machek
2008-04-26  8:04                             ` Pavel Machek
2008-04-26  8:04                               ` Pavel Machek
2008-04-28 15:13                               ` Mark Lord
2008-04-28 15:13                                 ` Mark Lord
2008-05-01 16:23                                 ` Pavel Machek
2008-04-22  7:57   ` [PATCH 2/11] x86: convert to generic helpers for " Jens Axboe
2008-04-22  7:57     ` Jens Axboe
     [not found]     ` <1208851058-8500-3-git-send-email-jens.axboe-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2008-04-22  8:38       ` Sam Ravnborg
2008-04-22  8:38         ` Sam Ravnborg
     [not found]         ` <20080422083810.GA23540-QabhHTsIXMSnlFQ6Q1D1Y0B+6BGkLq7r@public.gmane.org>
2008-04-22  8:43           ` Jens Axboe
2008-04-22  8:43             ` Jens Axboe
     [not found]             ` <20080422084315.GT12774-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org>
2008-04-22 11:15               ` Jens Axboe
2008-04-22 11:15                 ` Jens Axboe
2008-04-22  8:47       ` Ingo Molnar
2008-04-22  8:47         ` Ingo Molnar
     [not found]         ` <20080422084738.GB2388-X9Un+BFzKDI@public.gmane.org>
2008-04-22  8:48           ` Jacek Luczak
2008-04-22  8:48             ` Jacek Luczak
     [not found]             ` <480DA670.4060707-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2008-04-22  8:56               ` Jens Axboe
2008-04-22  8:56                 ` Jens Axboe
     [not found]                 ` <20080422085629.GV12774-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org>
2008-04-22  9:04                   ` Jacek Luczak
2008-04-22  9:04                     ` Jacek Luczak
2008-04-22  8:52           ` Jens Axboe
2008-04-22  8:52             ` Jens Axboe
2008-04-26  8:59           ` Jeremy Fitzhardinge
2008-04-26  8:59             ` Jeremy Fitzhardinge
2008-04-22  7:57   ` [PATCH 3/11] powerpc: " Jens Axboe
2008-04-22  7:57     ` Jens Axboe
     [not found]     ` <1208851058-8500-4-git-send-email-jens.axboe-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2008-04-22 12:03       ` Paul Mackerras
2008-04-22 12:03         ` Paul Mackerras
     [not found]         ` <18445.54284.194023.553595-UYQwCShxghk5kJ7NmlRacFaTQe2KTcn/@public.gmane.org>
2008-04-22 12:13           ` Jens Axboe
2008-04-22 12:13             ` Jens Axboe
     [not found]             ` <20080422121315.GE12774-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org>
2008-04-22 12:42               ` Paul Mackerras
2008-04-22 12:42                 ` Paul Mackerras
     [not found]                 ` <18445.56653.957832.720681-UYQwCShxghk5kJ7NmlRacFaTQe2KTcn/@public.gmane.org>
2008-04-22 18:51                   ` Jens Axboe
2008-04-22 18:51                     ` Jens Axboe
2008-04-22  7:57   ` [PATCH 4/11] ia64: " Jens Axboe
2008-04-22  7:57     ` Jens Axboe
2008-04-22  7:57   ` [PATCH 5/11] alpha: " Jens Axboe
2008-04-22  7:57     ` Jens Axboe
2008-04-22  7:57   ` [PATCH 6/11] arm: " Jens Axboe
2008-04-22  7:57     ` Jens Axboe
2008-04-22 15:00     ` Catalin Marinas
2008-04-22 15:00       ` Catalin Marinas
     [not found]       ` <1208876447.31997.30.camel-hhZApKj8DF/YkXV2EHHjLW3o5bpOHsLO@public.gmane.org>
2008-04-22 18:43         ` Jens Axboe
2008-04-22 18:43           ` Jens Axboe
2008-04-22  7:57   ` [PATCH 7/11] m32r: " Jens Axboe
2008-04-22  7:57     ` Jens Axboe
2008-04-22  7:57   ` [PATCH 8/11] mips: " Jens Axboe
2008-04-22  7:57     ` Jens Axboe
2008-04-22  7:57   ` [PATCH 9/11] parisc: " Jens Axboe
2008-04-22  7:57     ` Jens Axboe
     [not found]     ` <1208851058-8500-10-git-send-email-jens.axboe-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2008-04-22 14:09       ` Kyle McMartin
2008-04-22 14:09         ` Kyle McMartin
     [not found]         ` <20080422140914.GD19802-EK4dZfYtfFRW/gs8oUvUg/d9D2ou9A/h@public.gmane.org>
2008-04-22 14:27           ` Jens Axboe
2008-04-22 14:27             ` Jens Axboe
     [not found]             ` <20080422142738.GH12774-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org>
2008-04-22 14:30               ` Kyle McMartin
2008-04-22 14:30                 ` Kyle McMartin
     [not found]                 ` <20080422143016.GE19802-EK4dZfYtfFRW/gs8oUvUg/d9D2ou9A/h@public.gmane.org>
2008-04-22 14:49                   ` Jens Axboe
2008-04-22 14:49                     ` Jens Axboe
2008-04-22  7:57   ` [PATCH 10/11] sh: " Jens Axboe
2008-04-22  7:57     ` Jens Axboe
2008-04-22  7:57   ` [PATCH 11/11] s390: " 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
2008-04-22  8:48   ` [PATCH 0/11] Generic smp_call_function() and friends Peter Zijlstra
2008-04-22  8:48     ` Peter Zijlstra
  -- strict thread matches above, loose matches on Subject: below --
2008-04-22 18:50 [PATCH 0/11] Generic smp_call_function() #2 Jens Axboe
     [not found] ` <1208890227-24808-1-git-send-email-jens.axboe-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2008-04-22 18:50   ` [PATCH 2/11] x86: convert to generic helpers for IPI function calls 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

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).