projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
22bacca
)
mm: grab rcu read lock in move_pages()
author
Greg Thelen
<
[email protected]
>
Fri, 25 Feb 2011 22:44:13 +0000
(14:44 -0800)
committer
Linus Torvalds
<
[email protected]
>
Fri, 25 Feb 2011 23:07:36 +0000
(15:07 -0800)
The move_pages() usage of find_task_by_vpid() requires rcu_read_lock() to
prevent free_pid() from reclaiming the pid.
Without this patch, RCU warnings are printed in v2.6.38-rc4 move_pages()
with:
CONFIG_LOCKUP_DETECTOR=y
CONFIG_PREEMPT=y
CONFIG_LOCKDEP=y
CONFIG_PROVE_LOCKING=y
CONFIG_PROVE_RCU=y
Previously, migrate_pages() went through a similar transformation
replacing usage of tasklist_lock with rcu read lock:
commit
55cfaa3cbdd29c4919ecb5fb8965c310f357e48c
Author: Zeng Zhaoming <
[email protected]
>
Date: Thu Dec 2 14:31:13 2010 -0800
mm/mempolicy.c: add rcu read lock to protect pid structure
commit
1e50df39f6e2c3a4a3394df62baa8a213df16c54
Author: KOSAKI Motohiro <
[email protected]
>
Date: Thu Jan 13 15:46:14 2011 -0800
mempolicy: remove tasklist_lock from migrate_pages
Signed-off-by: Greg Thelen <
[email protected]
>
Cc: Mel Gorman <
[email protected]
>
Cc: Minchan Kim <
[email protected]
>
Cc: Rik van Riel <
[email protected]
>
Cc: KAMEZAWA Hiroyuki <
[email protected]
>
Cc: "Paul E. McKenney" <
[email protected]
>
Cc: Tetsuo Handa <
[email protected]
>
Cc: Sergey Senozhatsky <
[email protected]
>
Cc: Oleg Nesterov <
[email protected]
>
Cc: Zeng Zhaoming <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
mm/migrate.c
patch
|
blob
|
history
diff --git
a/mm/migrate.c
b/mm/migrate.c
index 7661152538074ee8018be8b87e1600021be5dc27..352de555626c4434471a53e29bee7a02516adfe3 100644
(file)
--- a/
mm/migrate.c
+++ b/
mm/migrate.c
@@
-1287,14
+1287,14
@@
SYSCALL_DEFINE6(move_pages, pid_t, pid, unsigned long, nr_pages,
return -EPERM;
/* Find the mm_struct */
- r
ead_lock(&tasklist_lock
);
+ r
cu_read_lock(
);
task = pid ? find_task_by_vpid(pid) : current;
if (!task) {
- r
ead_unlock(&tasklist_lock
);
+ r
cu_read_unlock(
);
return -ESRCH;
}
mm = get_task_mm(task);
- r
ead_unlock(&tasklist_lock
);
+ r
cu_read_unlock(
);
if (!mm)
return -EINVAL;