Re: [PATCH] Fix a complex race in hrtimer code.

From: Thomas Gleixner
Date: Tue Oct 12 2010 - 12:55:15 EST


On Tue, 12 Oct 2010, Salman Qazi wrote:
> On Tue, Oct 12, 2010 at 1:49 AM, Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:
> > On Mon, 11 Oct 2010, Salman Qazi wrote:
> >> /* There are other issues, like deadlocks between multiple hrtimer_start observed
> >>  * calls, at least in 2.6.34 that this lock works around.  Will look into
> >>  * those later.
> >
> > Well, we don't have to work around callsites not serializing themself
> > in the core code, right ?
>
> I assumed that the semantics were that hrtimer_starts are serialized
> with respect to each other and with respect to cancels. You seem to
> disagree.

Yes, I disagree. The code makes sure that cancel/start does not
conflict with a running callback, but it's not responsible for random
code fiddling with the same timer, really.

The outcome of random start/cancel operations on two cpus of the same
timer is just unpredictible, so where is the point of caring about
that in the core code ?

> In any case, I have to rerun that test without this lock with the
> patch present. It's possible that it was a symptom of the same bug
> that we just didn't observe in production.

Which bug did you observe in production and what's the code which is
triggering this?

Thanks,

tglx