Merge branch 'syscalls-next' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo...
[linux-2.6-microblaze.git] / kernel / sched / core.c
index b249adb..28b6899 100644 (file)
@@ -2462,17 +2462,17 @@ void wake_up_new_task(struct task_struct *p)
 
 #ifdef CONFIG_PREEMPT_NOTIFIERS
 
-static struct static_key preempt_notifier_key = STATIC_KEY_INIT_FALSE;
+static DEFINE_STATIC_KEY_FALSE(preempt_notifier_key);
 
 void preempt_notifier_inc(void)
 {
-       static_key_slow_inc(&preempt_notifier_key);
+       static_branch_inc(&preempt_notifier_key);
 }
 EXPORT_SYMBOL_GPL(preempt_notifier_inc);
 
 void preempt_notifier_dec(void)
 {
-       static_key_slow_dec(&preempt_notifier_key);
+       static_branch_dec(&preempt_notifier_key);
 }
 EXPORT_SYMBOL_GPL(preempt_notifier_dec);
 
@@ -2482,7 +2482,7 @@ EXPORT_SYMBOL_GPL(preempt_notifier_dec);
  */
 void preempt_notifier_register(struct preempt_notifier *notifier)
 {
-       if (!static_key_false(&preempt_notifier_key))
+       if (!static_branch_unlikely(&preempt_notifier_key))
                WARN(1, "registering preempt_notifier while notifiers disabled\n");
 
        hlist_add_head(&notifier->link, &current->preempt_notifiers);
@@ -2511,7 +2511,7 @@ static void __fire_sched_in_preempt_notifiers(struct task_struct *curr)
 
 static __always_inline void fire_sched_in_preempt_notifiers(struct task_struct *curr)
 {
-       if (static_key_false(&preempt_notifier_key))
+       if (static_branch_unlikely(&preempt_notifier_key))
                __fire_sched_in_preempt_notifiers(curr);
 }
 
@@ -2529,7 +2529,7 @@ static __always_inline void
 fire_sched_out_preempt_notifiers(struct task_struct *curr,
                                 struct task_struct *next)
 {
-       if (static_key_false(&preempt_notifier_key))
+       if (static_branch_unlikely(&preempt_notifier_key))
                __fire_sched_out_preempt_notifiers(curr, next);
 }
 
@@ -4942,7 +4942,7 @@ SYSCALL_DEFINE3(sched_getaffinity, pid_t, pid, unsigned int, len,
  *
  * Return: 0.
  */
-SYSCALL_DEFINE0(sched_yield)
+static void do_sched_yield(void)
 {
        struct rq_flags rf;
        struct rq *rq;
@@ -4963,7 +4963,11 @@ SYSCALL_DEFINE0(sched_yield)
        sched_preempt_enable_no_resched();
 
        schedule();
+}
 
+SYSCALL_DEFINE0(sched_yield)
+{
+       do_sched_yield();
        return 0;
 }
 
@@ -5047,7 +5051,7 @@ EXPORT_SYMBOL(__cond_resched_softirq);
 void __sched yield(void)
 {
        set_current_state(TASK_RUNNING);
-       sys_sched_yield();
+       do_sched_yield();
 }
 EXPORT_SYMBOL(yield);