diff options
author | Avi Kivity <avi@redhat.com> | 2009-11-29 09:34:48 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-11-29 16:03:04 -0500 |
commit | 8e7cac79808b62f242069a6ac88d364d35621371 (patch) | |
tree | b68dacc4e080ec8c4587d783a8014906e2eb2445 /include | |
parent | 3c912b6edaac56cb451e7571c95c15cbb6bd0c81 (diff) |
core: Fix user return notifier on fork()
fork() clones all thread_info flags, including
TIF_USER_RETURN_NOTIFY; if the new task is first scheduled on a cpu
which doesn't have user return notifiers set, this causes user
return notifiers to trigger without any way of clearing itself.
This is easy to trigger with a forky workload on the host in
parallel with kvm, resulting in a cpu in an endless loop on the
verge of returning to userspace.
Fix by dropping the TIF_USER_RETURN_NOTIFY immediately after fork.
Signed-off-by: Avi Kivity <avi@redhat.com>
LKML-Reference: <1259505288-16559-1-git-send-email-avi@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/user-return-notifier.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/user-return-notifier.h b/include/linux/user-return-notifier.h index b6ac056291d7..9c4a445bb43c 100644 --- a/include/linux/user-return-notifier.h +++ b/include/linux/user-return-notifier.h | |||
@@ -26,6 +26,11 @@ static inline void propagate_user_return_notify(struct task_struct *prev, | |||
26 | 26 | ||
27 | void fire_user_return_notifiers(void); | 27 | void fire_user_return_notifiers(void); |
28 | 28 | ||
29 | static inline void clear_user_return_notifier(struct task_struct *p) | ||
30 | { | ||
31 | clear_tsk_thread_flag(p, TIF_USER_RETURN_NOTIFY); | ||
32 | } | ||
33 | |||
29 | #else | 34 | #else |
30 | 35 | ||
31 | struct user_return_notifier {}; | 36 | struct user_return_notifier {}; |
@@ -37,6 +42,8 @@ static inline void propagate_user_return_notify(struct task_struct *prev, | |||
37 | 42 | ||
38 | static inline void fire_user_return_notifiers(void) {} | 43 | static inline void fire_user_return_notifiers(void) {} |
39 | 44 | ||
45 | static inline void clear_user_return_notifier(struct task_struct *p) {} | ||
46 | |||
40 | #endif | 47 | #endif |
41 | 48 | ||
42 | #endif | 49 | #endif |