Revision 73863ab028579ed98c4f1f36d016536b1b415344 authored by Anton Vorontsov on 31 May 2012, 23:26:23 UTC, committed by Linus Torvalds on 01 June 2012, 00:49:29 UTC
Current CPU hotplug code has some task->mm handling issues:

1. Working with task->mm w/o getting mm or grabing the task lock is
   dangerous as ->mm might disappear (exit_mm() assigns NULL under
   task_lock(), so tasklist lock is not enough).

   We can't use get_task_mm()/mmput() pair as mmput() might sleep,
   so we must take the task lock while handle its mm.

2. Checking for process->mm is not enough because process' main
   thread may exit or detach its mm via use_mm(), but other threads
   may still have a valid mm.

   To fix this we would need to use find_lock_task_mm(), which would
   walk up all threads and returns an appropriate task (with task
   lock held).

clear_tasks_mm_cpumask() has all the issues fixed, so let's use it.

Suggested-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 3eaa73b
History
File Mode Size
Kconfig -rw-r--r-- 13.3 KB
Makefile -rw-r--r-- 2.5 KB
spi-altera.c -rw-r--r-- 7.9 KB
spi-ath79.c -rw-r--r-- 6.4 KB
spi-atmel.c -rw-r--r-- 27.5 KB
spi-au1550.c -rw-r--r-- 26.1 KB
spi-bcm63xx.c -rw-r--r-- 11.9 KB
spi-bfin-sport.c -rw-r--r-- 23.0 KB
spi-bfin5xx.c -rw-r--r-- 40.5 KB
spi-bitbang-txrx.h -rw-r--r-- 3.0 KB
spi-bitbang.c -rw-r--r-- 13.1 KB
spi-butterfly.c -rw-r--r-- 8.5 KB
spi-coldfire-qspi.c -rw-r--r-- 15.2 KB
spi-davinci.c -rw-r--r-- 26.3 KB
spi-dw-mid.c -rw-r--r-- 6.0 KB
spi-dw-mmio.c -rw-r--r-- 3.2 KB
spi-dw-pci.c -rw-r--r-- 3.9 KB
spi-dw.c -rw-r--r-- 22.2 KB
spi-dw.h -rw-r--r-- 5.8 KB
spi-ep93xx.c -rw-r--r-- 30.8 KB
spi-fsl-espi.c -rw-r--r-- 17.7 KB
spi-fsl-lib.c -rw-r--r-- 5.8 KB
spi-fsl-lib.h -rw-r--r-- 3.5 KB
spi-fsl-spi.c -rw-r--r-- 27.8 KB
spi-gpio.c -rw-r--r-- 11.9 KB
spi-imx.c -rw-r--r-- 24.2 KB
spi-lm70llp.c -rw-r--r-- 9.1 KB
spi-mpc512x-psc.c -rw-r--r-- 13.7 KB
spi-mpc52xx-psc.c -rw-r--r-- 13.3 KB
spi-mpc52xx.c -rw-r--r-- 14.4 KB
spi-nuc900.c -rw-r--r-- 9.9 KB
spi-oc-tiny.c -rw-r--r-- 10.2 KB
spi-omap-100k.c -rw-r--r-- 15.6 KB
spi-omap-uwire.c -rw-r--r-- 13.3 KB
spi-omap2-mcspi.c -rw-r--r-- 32.2 KB
spi-orion.c -rw-r--r-- 12.9 KB
spi-pl022.c -rw-r--r-- 63.9 KB
spi-ppc4xx.c -rw-r--r-- 13.9 KB
spi-pxa2xx-pci.c -rw-r--r-- 3.8 KB
spi-pxa2xx.c -rw-r--r-- 47.0 KB
spi-rspi.c -rw-r--r-- 19.0 KB
spi-s3c24xx-fiq.S -rw-r--r-- 2.9 KB
spi-s3c24xx-fiq.h -rw-r--r-- 671 bytes
spi-s3c24xx.c -rw-r--r-- 16.3 KB
spi-s3c64xx.c -rw-r--r-- 32.5 KB
spi-sh-hspi.c -rw-r--r-- 7.0 KB
spi-sh-msiof.c -rw-r--r-- 17.3 KB
spi-sh-sci.c -rw-r--r-- 4.7 KB
spi-sh.c -rw-r--r-- 12.3 KB
spi-sirf.c -rw-r--r-- 18.5 KB
spi-stmp.c -rw-r--r-- 15.6 KB
spi-tegra.c -rw-r--r-- 15.6 KB
spi-ti-ssp.c -rw-r--r-- 9.2 KB
spi-tle62x0.c -rw-r--r-- 7.5 KB
spi-topcliff-pch.c -rw-r--r-- 48.3 KB
spi-txx9.c -rw-r--r-- 12.0 KB
spi-xilinx.c -rw-r--r-- 15.2 KB
spi.c -rw-r--r-- 42.9 KB
spidev.c -rw-r--r-- 17.4 KB

back to top