• Lai Jiangshan's avatar
    tiny_rcu: Directly force QS when call_rcu_[bh|sched]() on idle_task · 5f6130fa
    Lai Jiangshan authored
    For RCU in UP, context-switch = QS = GP, thus we can force a
    context-switch when any call_rcu_[bh|sched]() is happened on idle_task.
    After doing so, rcu_idle/irq_enter/exit() are useless, so we can simply
    make these functions empty.
    
    More important, this change does not change the functionality logically.
    Note: raise_softirq(RCU_SOFTIRQ)/rcu_sched_qs() in rcu_idle_enter() and
    outmost rcu_irq_exit() will have to wake up the ksoftirqd
    (due to in_interrupt() == 0).
    
    Before this patch		After this patch:
    call_rcu_sched() in idle;	call_rcu_sched() in idle
    				  set resched
    do other stuffs;		do other stuffs
    outmost rcu_irq_exit()		outmost rcu_irq_exit() (empty function)
      (or rcu_idle_enter())		  (or rcu_idle_enter(), also empty function)
    				start to resched. (see above)
      rcu_sched_qs()		rcu_sched_qs()
        QS,and GP and advance cb	  QS,and GP and advance cb
        wake up the ksoftirqd	    wake up the ksoftirqd
          set resched
    resched to ksoftirqd (or other)	resched to ksoftirqd (or other)
    
    These two code patches are almost the same.
    
    Size changed after patched:
    
    size kernel/rcu/tiny-old.o kernel/rcu/tiny-patched.o
       text	   data	    bss	    dec	    hex	filename
       3449	    206	      8	   3663	    e4f	kernel/rcu/tiny-old.o
       2406	    144	      8	   2558	    9fe	kernel/rcu/tiny-patched.o
    Signed-off-by: default avatarLai Jiangshan <laijs@cn.fujitsu.com>
    Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
    5f6130fa
rcu.h 4.71 KB