All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] core: clean up user return notifers use of per_cpu
@ 2009-11-30 10:54 Avi Kivity
  2009-12-02 10:44 ` [tip:x86/entry] core: Clean " tip-bot for Avi Kivity
  0 siblings, 1 reply; 2+ messages in thread
From: Avi Kivity @ 2009-11-30 10:54 UTC (permalink / raw)
  To: Ingo Molnar, H. Peter Anvin; +Cc: linux-kernel, kvm

Instead of using per_cpu(..., raw_smp_processor_id()), use __get_cpu_var(...).

Signed-off-by: Avi Kivity <avi@redhat.com>
---
 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 03e2d6f..eb27fd3 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);
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-12-02 10:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-30 10:54 [PATCH] core: clean up user return notifers use of per_cpu Avi Kivity
2009-12-02 10:44 ` [tip:x86/entry] core: Clean " tip-bot for Avi Kivity

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.