summaryrefslogtreecommitdiff
path: root/kernel/user-return-notifier.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2009-11-30 12:54:51 +0200
committerIngo Molnar <mingo@elte.hu>2009-12-02 10:22:59 +0100
commit1786bf009f18f722afbb62143c8541e7e60a4e92 (patch)
tree04e84d487132ae66754f59911ffc4f658845d373 /kernel/user-return-notifier.c
parent8e7cac79808b62f242069a6ac88d364d35621371 (diff)
core: Clean up user return notifers use of per_cpu
Instead of using per_cpu(..., raw_smp_processor_id()), use __get_cpu_var(...). Signed-off-by: Avi Kivity <avi@redhat.com> LKML-Reference: <1259578491-4589-1-git-send-email-avi@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/user-return-notifier.c')
-rw-r--r--kernel/user-return-notifier.c6
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 @@
static DEFINE_PER_CPU(struct hlist_head, return_notifier_list);
-#define URN_LIST_HEAD per_cpu(return_notifier_list, raw_smp_processor_id())
-
/*
* Request a notification when the current cpu returns to userspace. Must be
* 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);
void user_return_notifier_register(struct user_return_notifier *urn)
{
set_tsk_thread_flag(current, TIF_USER_RETURN_NOTIFY);
- hlist_add_head(&urn->link, &URN_LIST_HEAD);
+ hlist_add_head(&urn->link, &__get_cpu_var(return_notifier_list));
}
EXPORT_SYMBOL_GPL(user_return_notifier_register);
@@ -27,7 +25,7 @@ EXPORT_SYMBOL_GPL(user_return_notifier_register);
void user_return_notifier_unregister(struct user_return_notifier *urn)
{
hlist_del(&urn->link);
- if (hlist_empty(&URN_LIST_HEAD))
+ if (hlist_empty(&__get_cpu_var(return_notifier_list)))
clear_tsk_thread_flag(current, TIF_USER_RETURN_NOTIFY);
}
EXPORT_SYMBOL_GPL(user_return_notifier_unregister);