lkml.org 
[lkml]   [2006]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 2/2] hrtimer
Hi,

On Tue, 28 Mar 2006, Oleg Nesterov wrote:

> I also think this is racy.
>
> CPU_0 CPU_1
>
> hrtimer_wakeup:
>
> task = t->task;
> t->task = NULL;
>
> <--- INTERRUPT --->
>
> task is woken by signal,
> do_nanosleep() sees t->task == NULL,
> returns without hrtimer_cancel(),
> and __exits__.
>
> <--- RESUME --->
>
> wake_up_process(task);
>
> Instead of exit(), 'task' can go to TASK_STOPPED or TASK_UNINTERRUPTIBLE
> after return from do_nanosleep(), it will be awakened by hrtimer_wakeup()
> unexpectedly.

Indeed and my original patch did call hrtimer_cancel() unconditionally to
synchronize with a possibly running timer.
Thomas, could you please document it a bit better, when you modify my
patches?

bye, Roman
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-03-28 02:06    [W:0.041 / U:0.468 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site