lkml.org 
[lkml]   [2012]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC PATCH 5/6] implement per-cpu&per-domain state machine call_srcu()
From
Date
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..


\
 
 \ /
  Last update: 2012-03-06 16:33    [W:0.159 / U:0.728 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site