1
linux/arch/arm
Gilad Ben-Yossef 3fc498f165 smp: introduce a generic on_each_cpu_mask() function
We have lots of infrastructure in place to partition multi-core systems
such that we have a group of CPUs that are dedicated to specific task:
cgroups, scheduler and interrupt affinity, and cpuisol= boot parameter.
Still, kernel code will at times interrupt all CPUs in the system via IPIs
for various needs.  These IPIs are useful and cannot be avoided
altogether, but in certain cases it is possible to interrupt only specific
CPUs that have useful work to do and not the entire system.

This patch set, inspired by discussions with Peter Zijlstra and Frederic
Weisbecker when testing the nohz task patch set, is a first stab at trying
to explore doing this by locating the places where such global IPI calls
are being made and turning the global IPI into an IPI for a specific group
of CPUs.  The purpose of the patch set is to get feedback if this is the
right way to go for dealing with this issue and indeed, if the issue is
even worth dealing with at all.  Based on the feedback from this patch set
I plan to offer further patches that address similar issue in other code
paths.

This patch creates an on_each_cpu_mask() and on_each_cpu_cond()
infrastructure API (the former derived from existing arch specific
versions in Tile and Arm) and uses them to turn several global IPI
invocation to per CPU group invocations.

Core kernel:

on_each_cpu_mask() calls a function on processors specified by cpumask,
which may or may not include the local processor.

You must not call this function with disabled interrupts or from a
hardware interrupt handler or from a bottom half handler.

arch/arm:

Note that the generic version is a little different then the Arm one:

1. It has the mask as first parameter
2. It calls the function on the calling CPU with interrupts disabled,
   but this should be OK since the function is called on the other CPUs
   with interrupts disabled anyway.

arch/tile:

The API is the same as the tile private one, but the generic version
also calls the function on the with interrupts disabled in UP case

This is OK since the function is called on the other CPUs
with interrupts disabled.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Reviewed-by: Christoph Lameter <cl@linux.com>
Acked-by: Chris Metcalf <cmetcalf@tilera.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Matt Mackall <mpm@selenic.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Sasha Levin <levinsasha928@gmail.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Avi Kivity <avi@redhat.com>
Acked-by: Michal Nazarewicz <mina86@mina86.org>
Cc: Kosaki Motohiro <kosaki.motohiro@gmail.com>
Cc: Milton Miller <miltonm@bga.com>
Cc: Russell King <linux@arm.linux.org.uk>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-03-28 17:14:35 -07:00
..
boot ARM: device tree work 2012-03-27 16:47:35 -07:00
common Merge branch 'platforms' of git://git.linaro.org/people/rmk/linux-arm 2012-03-27 18:17:02 -07:00
configs ARM: driver specific updates 2012-03-27 16:41:24 -07:00
include/asm Merge branch 'platforms' of git://git.linaro.org/people/rmk/linux-arm 2012-03-27 18:17:02 -07:00
kernel smp: introduce a generic on_each_cpu_mask() function 2012-03-28 17:14:35 -07:00
lib
mach-at91 ARM: device tree work 2012-03-27 16:47:35 -07:00
mach-bcmring Merge branch 'for-armsoc' of git://git.linaro.org/people/rmk/linux-arm 2012-03-23 17:30:49 -07:00
mach-clps711x
mach-cns3xxx Merge branch 'for-armsoc' of git://git.linaro.org/people/rmk/linux-arm 2012-03-23 17:30:49 -07:00
mach-davinci ARM: global cleanups 2012-03-27 16:03:32 -07:00
mach-dove Merge branch 'for-armsoc' of git://git.linaro.org/people/rmk/linux-arm 2012-03-23 17:30:49 -07:00
mach-ebsa110 Merge branch 'platforms' of git://git.linaro.org/people/rmk/linux-arm 2012-03-27 18:17:02 -07:00
mach-ep93xx Merge tag 'asoc-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into next/boards 2012-03-27 15:18:19 -07:00
mach-exynos ARM: driver specific updates 2012-03-27 16:41:24 -07:00
mach-footbridge Merge branch 'for-armsoc' of git://git.linaro.org/people/rmk/linux-arm 2012-03-23 17:30:49 -07:00
mach-gemini
mach-h720x
mach-highbank ARM: SoC specific updates 2012-03-27 16:14:44 -07:00
mach-imx ARM: device tree work 2012-03-27 16:47:35 -07:00
mach-integrator Merge branch 'for-armsoc' of git://git.linaro.org/people/rmk/linux-arm 2012-03-23 17:30:49 -07:00
mach-iop13xx Merge branch 'for-armsoc' of git://git.linaro.org/people/rmk/linux-arm 2012-03-23 17:30:49 -07:00
mach-iop32x
mach-iop33x
mach-ixp4xx Merge branch 'for-armsoc' of git://git.linaro.org/people/rmk/linux-arm 2012-03-23 17:30:49 -07:00
mach-ixp23xx Merge branch 'for-armsoc' of git://git.linaro.org/people/rmk/linux-arm 2012-03-23 17:30:49 -07:00
mach-ixp2000 Merge branch 'for-armsoc' of git://git.linaro.org/people/rmk/linux-arm 2012-03-23 17:30:49 -07:00
mach-kirkwood ARM: board specific updates 2012-03-27 16:27:28 -07:00
mach-ks8695 Merge branch 'for-armsoc' of git://git.linaro.org/people/rmk/linux-arm 2012-03-23 17:30:49 -07:00
mach-l7200/include/mach
mach-lpc32xx ARM: driver specific updates 2012-03-27 16:41:24 -07:00
mach-mmp ARM: device tree work 2012-03-27 16:47:35 -07:00
mach-msm ARM: timer cleanup work 2012-03-27 16:06:17 -07:00
mach-mv78xx0 Merge branch 'for-armsoc' of git://git.linaro.org/people/rmk/linux-arm 2012-03-23 17:30:49 -07:00
mach-mxs ARM: driver specific updates 2012-03-27 16:41:24 -07:00
mach-netx
mach-nomadik Merge branch 'tegra/cleanups' into next/timer 2012-03-21 14:27:34 +00:00
mach-omap1 ARM: board specific updates 2012-03-27 16:27:28 -07:00
mach-omap2 ARM: device tree work 2012-03-27 16:47:35 -07:00
mach-orion5x Merge branch 'for-armsoc' of git://git.linaro.org/people/rmk/linux-arm 2012-03-23 17:30:49 -07:00
mach-picoxcell
mach-pnx4008
mach-prima2 Merge branch 'for-armsoc' of git://git.linaro.org/people/rmk/linux-arm 2012-03-23 17:30:49 -07:00
mach-pxa Merge branch 'platforms' of git://git.linaro.org/people/rmk/linux-arm 2012-03-27 18:17:02 -07:00
mach-realview ARM: timer cleanup work 2012-03-27 16:06:17 -07:00
mach-rpc Merge branch 'platforms' of git://git.linaro.org/people/rmk/linux-arm 2012-03-27 18:17:02 -07:00
mach-s3c24xx ARM: driver specific updates 2012-03-27 16:41:24 -07:00
mach-s3c64xx ARM: board specific updates 2012-03-27 16:27:28 -07:00
mach-s3c2410 Merge branch 'for-armsoc' of git://git.linaro.org/people/rmk/linux-arm 2012-03-23 17:30:49 -07:00
mach-s3c2412 Merge branch 'for-armsoc' of git://git.linaro.org/people/rmk/linux-arm 2012-03-23 17:30:49 -07:00
mach-s3c2440 Merge branch 'next/fixes-non-critical' into next/drivers 2012-03-20 22:42:24 +00:00
mach-s5p64x0 Merge branch 'for-armsoc' of git://git.linaro.org/people/rmk/linux-arm 2012-03-23 17:30:49 -07:00
mach-s5pc100
mach-s5pv210 ARM: board specific updates 2012-03-27 16:27:28 -07:00
mach-sa1100 Merge branch 'platforms' of git://git.linaro.org/people/rmk/linux-arm 2012-03-27 18:17:02 -07:00
mach-shark
mach-shmobile ARM: timer cleanup work 2012-03-27 16:06:17 -07:00
mach-spear3xx Merge branch 'for-armsoc' of git://git.linaro.org/people/rmk/linux-arm 2012-03-23 17:30:49 -07:00
mach-spear6xx
mach-tegra ARM: driver specific updates 2012-03-27 16:41:24 -07:00
mach-u300 Merge tag 'regulator-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into next/drivers 2012-03-24 11:29:58 +00:00
mach-ux500 ARM: timer cleanup work 2012-03-27 16:06:17 -07:00
mach-versatile Merge branch 'for-armsoc' of git://git.linaro.org/people/rmk/linux-arm 2012-03-23 17:30:49 -07:00
mach-vexpress ARM: device tree work 2012-03-27 16:47:35 -07:00
mach-vt8500
mach-w90x900
mach-zynq
mm Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci 2012-03-23 14:02:12 -07:00
nwfpe
oprofile
plat-iop
plat-mxc ARM: device tree work 2012-03-27 16:47:35 -07:00
plat-nomadik
plat-omap ARM: device tree work 2012-03-27 16:47:35 -07:00
plat-orion
plat-pxa
plat-s3c24xx Merge branch 'for-armsoc' of git://git.linaro.org/people/rmk/linux-arm 2012-03-23 17:30:49 -07:00
plat-s5p Merge branch 'samsung/cleanup-exynos-clock' into next/soc 2012-03-20 10:07:48 +00:00
plat-samsung ARM: driver specific updates 2012-03-27 16:41:24 -07:00
plat-spear Merge branch 'for-armsoc' of git://git.linaro.org/people/rmk/linux-arm 2012-03-23 17:30:49 -07:00
plat-versatile ARM: plat-versatile: convert to twd_local_timer_register() interface 2012-03-13 13:29:58 +00:00
tools
vfp
Kconfig Merge branch 'platforms' of git://git.linaro.org/people/rmk/linux-arm 2012-03-27 18:17:02 -07:00
Kconfig-nommu
Kconfig.debug
Makefile