lkml.org 
[lkml]   [2005]   [Mar]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] del_timer_sync scalability patch
I suspect that del_timer_sync() in its current form is racy.

CPU 0 CPU 1

__run_timers() sets timer->base = NULL

del_timer_sync() starts, calls del_timer(), it returns
because timer->base == NULL.

waits until the run is complete:
while (base->running_timer == timer)
preempt_check_resched();

calls schedule(), or long interrupt happens.

timer reschedules itself, __run_timers()
exits.

base->running_timer == NULL, end of loop.

next timer interrupt, __run_timers() picks
this timer again, sets timer->base = NULL

if (timer_pending(timer)) // no, timer->base == NULL
goto del_again; // not taken

del_timer_sync() returns

timer runs.

No?

Oleg.
-
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: 2005-03-22 14:11    [W:0.225 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site