lkml.org 
[lkml]   [2015]   [Jun]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 08/14] hrtimer: Allow hrtimer::function() to free the timer
On 06/08, Peter Zijlstra wrote:
>
> On Mon, Jun 08, 2015 at 04:27:49PM +0200, Oleg Nesterov wrote:
> >
> > Most probably I missed something... I'll try to think more, but perhaps
> > you see a hole immediately?
>
> This is something I proposed earlier; Kirill said:
>
> lkml.kernel.org/r/2134411433408823@web8j.yandex.ru
>
> Which I read like the below, imagine our timer expires periodically and
> rearms itself:
>
> acquire
> cpu_base->running = timer;
> wmb
> timer->state = INACTIVE;
> release
> [R] timer->state (== INACTIVE)
> fn()
> acquire
> timer->state = ACTIVE
> wmb
> cpu_base->running = NULL
> release
>
> [R] cpu_base->running (== NULL)
>
> acquire
> cpu_base->running = timer;
> wmb
> timer->state = INACTIVE;
> release
>
> [R] timer->state (== INACTIVE)

Damn yes. Thanks Kirill and Peter.

And I swear, I swear I was thinking about this race yesterday but
forgot this problem today ;)

Yes it seems that we can't avoid the seq counter. But perhaps we
can increment/check it once in run_hrtimer/hrtimer_inactive ...
I'll try to think.

Thanks!

Oleg.



\
 
 \ /
  Last update: 2015-06-08 18:21    [W:0.102 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site