Re: RT and Cascade interrupts

Oleg Nesterov
2005-05-27T16:39:20Z

john cooper wrote:
>
> rpc_delete_timer(struct rpc_task *task)
> {
> - if (test_and_clear_bit(RPC_TASK_HAS_TIMER, &task->tk_runstate)) {
> + if (task->tk_timer.base) {
> del_singleshot_timer_sync(&task->tk_timer);
> dprintk("RPC: %4d deleting timer\n", task->tk_pid);
> }

I know nothing about rpc, but this looks completely wrong to me.

Please don't use the ->base directly, use timer_pending(). This
field is never NULL in -mm tree.

Next, timer_pending() == 0 does not mean that del_timer_sync() is
not needed, it may be running on the other CPU.

Looking at the code for the first time, I can guess that RPC_TASK_HAS_TIMER
was invented to indicate when it is safe not to wait for timer
completition. This bit is cleared after ->tk_timeout_fn call in
the timer's handler. After that rpc_run_timer will not touch *task.

Oleg.