[patch] BFS 421-1: refactor sys_sched_yield

From: Hillf Danton
Date: Mon Jul 09 2012 - 08:24:33 EST


Runqueue lock is replaced with preempt.

SOB: Hillf Danton <dhillf@xxxxxxxxx>
---

--- a/kernel/sched/bfs.c Mon Jul 9 20:06:50 2012
+++ b/kernel/sched/bfs.c Mon Jul 9 20:08:50 2012
@@ -4518,19 +4518,8 @@ SYSCALL_DEFINE3(sched_getaffinity, pid_t
*/
SYSCALL_DEFINE0(sched_yield)
{
- struct task_struct *p;
-
- p = current;
- grq_lock_irq();
- schedstat_inc(task_rq(p), yld_count);
-
- /*
- * Since we are going to call schedule() anyway, there's
- * no need to preempt or enable interrupts:
- */
- __release(grq.lock);
- spin_release(&grq.lock.dep_map, 1, _THIS_IP_);
- do_raw_spin_unlock(&grq.lock);
+ preempt_disable();
+ schedstat_inc(this_rq(), yld_count);
preempt_enable_no_resched();

schedule();
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/