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-- 7.6 KB
Makefile -rw-r--r-- 1.3 KB
aes_ccm.c -rw-r--r-- 3.4 KB
aes_ccm.h -rw-r--r-- 784 bytes
aes_cmac.c -rw-r--r-- 2.6 KB
aes_cmac.h -rw-r--r-- 574 bytes
agg-rx.c -rw-r--r-- 11.1 KB
agg-tx.c -rw-r--r-- 27.0 KB
cfg.c -rw-r--r-- 76.8 KB
cfg.h -rw-r--r-- 155 bytes
chan.c -rw-r--r-- 2.9 KB
debugfs.c -rw-r--r-- 11.2 KB
debugfs.h -rw-r--r-- 373 bytes
debugfs_key.c -rw-r--r-- 8.9 KB
debugfs_key.h -rw-r--r-- 1.1 KB
debugfs_netdev.c -rw-r--r-- 18.9 KB
debugfs_netdev.h -rw-r--r-- 706 bytes
debugfs_sta.c -rw-r--r-- 11.7 KB
debugfs_sta.h -rw-r--r-- 427 bytes
driver-ops.h -rw-r--r-- 20.4 KB
driver-trace.c -rw-r--r-- 230 bytes
driver-trace.h -rw-r--r-- 31.4 KB
event.c -rw-r--r-- 913 bytes
ht.c -rw-r--r-- 12.0 KB
ibss.c -rw-r--r-- 33.0 KB
ieee80211_i.h -rw-r--r-- 45.4 KB
iface.c -rw-r--r-- 40.1 KB
key.c -rw-r--r-- 18.0 KB
key.h -rw-r--r-- 3.9 KB
led.c -rw-r--r-- 7.9 KB
led.h -rw-r--r-- 2.1 KB
main.c -rw-r--r-- 29.7 KB
mesh.c -rw-r--r-- 22.5 KB
mesh.h -rw-r--r-- 12.9 KB
mesh_hwmp.c -rw-r--r-- 32.5 KB
mesh_pathtbl.c -rw-r--r-- 29.2 KB
mesh_plink.c -rw-r--r-- 25.4 KB
mesh_sync.c -rw-r--r-- 9.2 KB
michael.c -rw-r--r-- 2.2 KB
michael.h -rw-r--r-- 573 bytes
mlme.c -rw-r--r-- 98.3 KB
offchannel.c -rw-r--r-- 8.0 KB
pm.c -rw-r--r-- 3.5 KB
rate.c -rw-r--r-- 13.0 KB
rate.h -rw-r--r-- 4.2 KB
rc80211_minstrel.c -rw-r--r-- 15.8 KB
rc80211_minstrel.h -rw-r--r-- 2.3 KB
rc80211_minstrel_debugfs.c -rw-r--r-- 4.7 KB
rc80211_minstrel_ht.c -rw-r--r-- 22.9 KB
rc80211_minstrel_ht.h -rw-r--r-- 2.9 KB
rc80211_minstrel_ht_debugfs.c -rw-r--r-- 3.3 KB
rc80211_pid.h -rw-r--r-- 7.7 KB
rc80211_pid_algo.c -rw-r--r-- 14.6 KB
rc80211_pid_debugfs.c -rw-r--r-- 5.9 KB
rx.c -rw-r--r-- 85.8 KB
scan.c -rw-r--r-- 26.3 KB
spectmgmt.c -rw-r--r-- 2.8 KB
sta_info.c -rw-r--r-- 36.3 KB
sta_info.h -rw-r--r-- 18.3 KB
status.c -rw-r--r-- 19.8 KB
tkip.c -rw-r--r-- 11.8 KB
tkip.h -rw-r--r-- 917 bytes
tx.c -rw-r--r-- 75.7 KB
util.c -rw-r--r-- 44.8 KB
wep.c -rw-r--r-- 9.5 KB
wep.h -rw-r--r-- 1.1 KB
wme.c -rw-r--r-- 4.4 KB
wme.h -rw-r--r-- 742 bytes
work.c -rw-r--r-- 8.3 KB
wpa.c -rw-r--r-- 17.0 KB
wpa.h -rw-r--r-- 1.1 KB

back to top