diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-08 16:24:20 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-08 16:24:20 -0500 |
commit | 4d2a914239eee6fcddd12a7c9c32e135dde8f3f1 (patch) | |
tree | 55100d41d0771f1f47083c886475c2fbaf648751 /kernel | |
parent | 9e9868a7372afc60615e8e11db246a91a121654d (diff) | |
parent | 1786bf009f18f722afbb62143c8541e7e60a4e92 (diff) |
Merge branch 'x86-entry-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'x86-entry-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
core: Clean up user return notifers use of per_cpu
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/user-return-notifier.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/kernel/user-return-notifier.c b/kernel/user-return-notifier.c index 03e2d6fd9b18..eb27fd3430a2 100644 --- a/kernel/user-return-notifier.c +++ b/kernel/user-return-notifier.c | |||
@@ -6,8 +6,6 @@ | |||
6 | 6 | ||
7 | static DEFINE_PER_CPU(struct hlist_head, return_notifier_list); | 7 | static DEFINE_PER_CPU(struct hlist_head, return_notifier_list); |
8 | 8 | ||
9 | #define URN_LIST_HEAD per_cpu(return_notifier_list, raw_smp_processor_id()) | ||
10 | |||
11 | /* | 9 | /* |
12 | * Request a notification when the current cpu returns to userspace. Must be | 10 | * Request a notification when the current cpu returns to userspace. Must be |
13 | * called in atomic context. The notifier will also be called in atomic | 11 | * called in atomic context. The notifier will also be called in atomic |
@@ -16,7 +14,7 @@ static DEFINE_PER_CPU(struct hlist_head, return_notifier_list); | |||
16 | void user_return_notifier_register(struct user_return_notifier *urn) | 14 | void user_return_notifier_register(struct user_return_notifier *urn) |
17 | { | 15 | { |
18 | set_tsk_thread_flag(current, TIF_USER_RETURN_NOTIFY); | 16 | set_tsk_thread_flag(current, TIF_USER_RETURN_NOTIFY); |
19 | hlist_add_head(&urn->link, &URN_LIST_HEAD); | 17 | hlist_add_head(&urn->link, &__get_cpu_var(return_notifier_list)); |
20 | } | 18 | } |
21 | EXPORT_SYMBOL_GPL(user_return_notifier_register); | 19 | EXPORT_SYMBOL_GPL(user_return_notifier_register); |
22 | 20 | ||
@@ -27,7 +25,7 @@ EXPORT_SYMBOL_GPL(user_return_notifier_register); | |||
27 | void user_return_notifier_unregister(struct user_return_notifier *urn) | 25 | void user_return_notifier_unregister(struct user_return_notifier *urn) |
28 | { | 26 | { |
29 | hlist_del(&urn->link); | 27 | hlist_del(&urn->link); |
30 | if (hlist_empty(&URN_LIST_HEAD)) | 28 | if (hlist_empty(&__get_cpu_var(return_notifier_list))) |
31 | clear_tsk_thread_flag(current, TIF_USER_RETURN_NOTIFY); | 29 | clear_tsk_thread_flag(current, TIF_USER_RETURN_NOTIFY); |
32 | } | 30 | } |
33 | EXPORT_SYMBOL_GPL(user_return_notifier_unregister); | 31 | EXPORT_SYMBOL_GPL(user_return_notifier_unregister); |