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
iscsi
loopback
sbp
tcm_fc
Kconfig -rw-r--r-- 1.1 KB
Makefile -rw-r--r-- 801 bytes
target_core_alua.c -rw-r--r-- 57.0 KB
target_core_alua.h -rw-r--r-- 5.4 KB
target_core_cdb.c -rw-r--r-- 31.0 KB
target_core_configfs.c -rw-r--r-- 87.6 KB
target_core_device.c -rw-r--r-- 45.5 KB
target_core_fabric_configfs.c -rw-r--r-- 34.3 KB
target_core_fabric_lib.c -rw-r--r-- 12.3 KB
target_core_file.c -rw-r--r-- 15.7 KB
target_core_file.h -rw-r--r-- 937 bytes
target_core_hba.c -rw-r--r-- 4.4 KB
target_core_iblock.c -rw-r--r-- 16.4 KB
target_core_iblock.h -rw-r--r-- 475 bytes
target_core_internal.h -rw-r--r-- 5.8 KB
target_core_pr.c -rw-r--r-- 131.3 KB
target_core_pr.h -rw-r--r-- 2.1 KB
target_core_pscsi.c -rw-r--r-- 30.8 KB
target_core_pscsi.h -rw-r--r-- 1.3 KB
target_core_rd.c -rw-r--r-- 11.8 KB
target_core_rd.h -rw-r--r-- 1.2 KB
target_core_stat.c -rw-r--r-- 52.4 KB
target_core_tmr.c -rw-r--r-- 13.5 KB
target_core_tpg.c -rw-r--r-- 23.0 KB
target_core_transport.c -rw-r--r-- 120.3 KB
target_core_ua.c -rw-r--r-- 9.0 KB
target_core_ua.h -rw-r--r-- 1.4 KB

back to top