lkml.org 
[lkml]   [2010]   [Oct]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Question about synchronize_sched_expedited()
On Mon, Oct 25, 2010 at 06:03:43PM +0200, Tejun Heo wrote:
> Hello, Paul.
>
> On 10/25/2010 05:43 PM, Paul E. McKenney wrote:
> > Hello, Tejun,
> >
> > I was taking another look at synchronize_sched_expedited(), and was
> > concerned about the scenario listed out in the following commit.
> > Is this scenario a real problem, or am I missing the synchronization
> > that makes it safe?
> >
> > (If my concerns are valid, I should also be able to change this
> > to non-atomically increment synchronize_sched_expedited_count, but
> > one step at a time...)
>
> I think your concern is valid and this can happen w/o preemption given
> enough cpus and perfect timing. Was the original code free from this
> problem?

I believe so -- there was a mutex guarding the whole operation, including
the increment.

> IMHO the counter based mechanism is a bit too difficult to ponder and
> verify. Can we do more conventional double queueing (ie. flipping
> pending and executing queues so that multiple sync calls can get
> coalesced while another one is in progress)? That's what the code is
> trying to achieve anyway, right?

Hmmm... But it would be necessary to flip the queues somewhere, and
wouldn't determining where that somewhere was involve the same analysis
and complexity as determining where to increment the counter?

Thanx, Paul


\
 
 \ /
  Last update: 2010-10-25 21:45    [W:0.040 / U:1.732 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site