mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-05 08:26:59 +00:00
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
This commit is contained in:
commit
4d2a914239
1 changed files with 2 additions and 4 deletions
|
@ -6,8 +6,6 @@
|
||||||
|
|
||||||
static DEFINE_PER_CPU(struct hlist_head, return_notifier_list);
|
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
|
* Request a notification when the current cpu returns to userspace. Must be
|
||||||
* called in atomic context. The notifier will also be called in atomic
|
* 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)
|
void user_return_notifier_register(struct user_return_notifier *urn)
|
||||||
{
|
{
|
||||||
set_tsk_thread_flag(current, TIF_USER_RETURN_NOTIFY);
|
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);
|
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)
|
void user_return_notifier_unregister(struct user_return_notifier *urn)
|
||||||
{
|
{
|
||||||
hlist_del(&urn->link);
|
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);
|
clear_tsk_thread_flag(current, TIF_USER_RETURN_NOTIFY);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(user_return_notifier_unregister);
|
EXPORT_SYMBOL_GPL(user_return_notifier_unregister);
|
||||||
|
|
Loading…
Reference in a new issue