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:
edcad25
)
vm_is_stack: use for_each_thread() rather then buggy while_each_thread()
author
Oleg Nesterov
<
[email protected]
>
Fri, 8 Aug 2014 21:19:17 +0000
(14:19 -0700)
committer
Linus Torvalds
<
[email protected]
>
Fri, 8 Aug 2014 22:57:17 +0000
(15:57 -0700)
Aleksei hit the soft lockup during reading /proc/PID/smaps. David
investigated the problem and suggested the right fix.
while_each_thread() is racy and should die, this patch updates
vm_is_stack().
Signed-off-by: Oleg Nesterov <
[email protected]
>
Reported-by: Aleksei Besogonov <
[email protected]
>
Tested-by: Aleksei Besogonov <
[email protected]
>
Suggested-by: David Rientjes <
[email protected]
>
Cc: <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
mm/util.c
patch
|
blob
|
history
diff --git
a/mm/util.c
b/mm/util.c
index 7b6608df2ee803d9d4345dc11290eb17100199f4..093c973f1697dd39545c6c93aeac8e9c3d60cf52 100644
(file)
--- a/
mm/util.c
+++ b/
mm/util.c
@@
-183,17
+183,14
@@
pid_t vm_is_stack(struct task_struct *task,
if (in_group) {
struct task_struct *t;
- rcu_read_lock();
- if (!pid_alive(task))
- goto done;
-
t = task
;
-
do
{
+
rcu_read_lock()
;
+
for_each_thread(task, t)
{
if (vm_is_stack_for_task(t, vma)) {
ret = t->pid;
goto done;
}
- }
while_each_thread(task, t);
+ }
done:
rcu_read_unlock();
}