rcu: Yield simpler

The rcu_yield() code is amazing. It's there to avoid starvation of the
system when lots of (boosting) work is to be done.

Now looking at the code it's functionality is:

 Make the thread SCHED_OTHER and very nice, i.e. get it out of the way
 Arm a timer with 2 ticks
 schedule()

Now if the system goes idle the rcu task returns, regains SCHED_FIFO
and plugs on. If the systems stays busy the timer fires and wakes a
per node kthread which in turn makes the per cpu thread SCHED_FIFO and
brings it back on the cpu. For the boosting thread the "make it FIFO"
bit is missing and it just runs some magic boost checks. Now this is a
lot of code with extra threads and complexity.

It's way simpler to let the tasks when they detect overload schedule
away for 2 ticks and defer the normal wakeup as long as they are in
yielded state and the cpu is not idle.

That solves the same problem and the only difference is that when the
cpu goes idle it's not guaranteed that the thread returns right away,
but it won't be longer out than two ticks, so no harm is done. If
that's an issue than it is way simpler just to wake the task from
idle as RCU has callbacks there anyway.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Namhyung Kim <namhyung@kernel.org>
Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/20120716103948.131256723@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

Conflicts:
	kernel/rcutree.h
	kernel/rcutree_plugin.h
rcu: Use smp_hotplug_thread facility for RCUs per-CPU kthread

Bring RCU into the new-age CPU-hotplug fold by modifying RCU's per-CPU
kthread code to use the new smp_hotplug_thread facility.

[ tglx: Adapted it to use callbacks and to the simplified rcu yield ]

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/20120716103948.673354828@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

Conflicts:
	kernel/rcutree.c
	kernel/rcutree.h
	kernel/rcutree_plugin.h
Revert "sched: reinitialize rq->next_balance when a CPU is hot-added"

This reverts commit ff1a78c96a97a4a4b6fd3405f7be9543ef8332c2.

Revert "nohz: stat: Fix CPU idle time accounting"

This reverts commit 201ab603673f4007e26350e8ecb89ee7563c7ee1.

Revert "sched: remove redundant update_runtime notifier"

This reverts commit 755305a60021cd32736c876fce03dfaba52e6a84.

Revert "sched,rt: disable rt_runtime borrowing by default"

This reverts commit b7e4061cf5a93f3fe2702ec79aaf61b7495375e9.

Revert "sched/rt: Remove redundant nr_cpus_allowed test"

This reverts commit 18f87a01c955253487b8a6fca2e94ef0a57fac60.

Revert "sched: Micro-optimize the smart wake-affine logic"

This reverts commit 5219d51eca28a8e02d136e142d8188e14e4abc62.

Revert "sched: Implement smarter wake-affine logic"

This reverts commit c93bc0af21dc9921a23e8a77a207b81781896773.

Revert "sched: Reduce overestimating rq->avg_idle"

This reverts commit 80ca5758d20583282e33927c43293d618b55e41f.

Revert "sched: scale the busy and this queue's per-task load before compare"

This reverts commit 785aa0522f4cbec1eabc2c077f016db543684df4.

Revert "sched: reduce calculation effort in fix_small_imbalance"

This reverts commit 769ec1bfe483138827c8e225588c7b4228fba15e.

Conflicts:
	kernel/sched/rt.c