Messages in this thread | | | Subject | Re: [RFC PATCH 5/6] implement per-cpu&per-domain state machine call_srcu() | From | Peter Zijlstra <> | Date | Tue, 06 Mar 2012 16:31:10 +0100 |
| |
On Tue, 2012-03-06 at 22:44 +0800, Lai Jiangshan wrote: > >> + if ((++idle_loop & 0xF) == 0) { > >> + spin_unlock_irq(&sp->gp_lock); > >> + udelay(1); > >> + spin_lock_irq(&sp->gp_lock); > >> + } > > > > The purpose of this bit isn't quite clear to me, is this simply a lock > > break? > > Yes, the main purpose is: > make the time of sp->gp_lock short, can be determined.
either introduce cond_resched_lock_irq() or write something like:
if (need_resched() || spin_needbreak(&sp->gp_lock)) { spin_unlock_irq(&sp->gp_lock); cond_resched(); spin_lock_irq(&sp->gp_lock); }
udelay(1) is complete nonsense..
| |