]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
dtrace: move SDT call location for surrender probe
authorKris Van Hees <kris.van.hees@oracle.com>
Thu, 7 Feb 2013 21:35:09 +0000 (16:35 -0500)
committerNick Alcock <nick.alcock@oracle.com>
Mon, 29 Jun 2015 21:41:42 +0000 (22:41 +0100)
Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
kernel/sched/core.c

index 0c0dc2b36058dfd6ba7e36b5573318e17cef7dea..801a275d5d0e68f29ab1c7db9f98037d338d6355 100644 (file)
@@ -4229,8 +4229,6 @@ SYSCALL_DEFINE0(sched_yield)
        schedstat_inc(rq, yld_count);
        current->sched_class->yield_task(rq);
 
-       DTRACE_SCHED1(surrender, struct task_struct *, current);
-
        /*
         * Since we are going to call schedule() anyway, there's
         * no need to preempt or enable interrupts:
@@ -4240,6 +4238,7 @@ SYSCALL_DEFINE0(sched_yield)
        do_raw_spin_unlock(&rq->lock);
        sched_preempt_enable_no_resched();
 
+       DTRACE_SCHED1(surrender, struct task_struct *, current);
        schedule();
 
        return 0;
@@ -4379,8 +4378,6 @@ again:
 
        yielded = curr->sched_class->yield_to_task(rq, p, preempt);
        if (yielded) {
-               DTRACE_SCHED1(surrender, struct task_struct *, curr);
-
                schedstat_inc(rq, yld_count);
                /*
                 * Make p's CPU reschedule; pick_next_entity takes care of
@@ -4395,8 +4392,10 @@ out_unlock:
 out_irq:
        local_irq_restore(flags);
 
-       if (yielded > 0)
+       if (yielded > 0) {
+               DTRACE_SCHED1(surrender, struct task_struct *, curr);
                schedule();
+       }
 
        return yielded;
 }