Excellent; I'm extremely grateful for this work...
> But del_timer_sync(), like del_timer() still must not be used on
> self-kfreeing timers. I think a variant could be made to do so quite
> easily (esp. if Linus chooses the right patch).
>
> - grab the timerlist_lock
> - see if any timers are running. If so, unlock and retry.
> - walk the tvecs looking for the timer.
No, delete_self_deleting_timer_sync() would look like:
- grab the timerlist_lock
- detach_timer
- if that succeeds, release lock
- if that failed:
- if timer is running now, release lock, spin until its done
- if timer isn't running, release lock, BUG()
This is required, because if you call `del_timer(&timer)' you *need*
to know (because you have your own spinlocks) that it hasn't run yet,
or is running at the moment. That's because if it's finished running,
you might now be deleting a completely unrelated timer...
Enjoy!
Rusty.
-- Hacking time.- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/