Thread (1 message) 1 message, 1 author, 2010-06-10

Re: [PATCH v3] netdev:bfin_mac: reclaim and free tx skb as soon as possible after transfer

From: Sonic Zhang <hidden>
Date: 2010-06-10 09:44:02

On Tue, Jun 8, 2010 at 12:22 PM, David Miller [off-list ref] wrote:
From: sonic zhang <redacted>
Date: Mon, 7 Jun 2010 18:38:24 +0800
quoted
+     if (timer_pending(&lp->tx_reclaim_timer))
+             del_timer(&(lp->tx_reclaim_timer));
+
Please remove the excess parenthesis around lp->tx_reclaim_timer being
passed to del_timer().

Also, you can unconditionally call del_timer().  If the timer isn't running
the call won't do anything.
OK
But you have to do something to make sure you don't race with the code that
enables the timer, f.e. what keeps the timer from being scheduled right
after you make this del_timer() call?
Sorry, I don't understand. If the timer is removed from the timer base
list,  how can it be scheduled? Timeout callbacks are scheduled only
in __run_timers() in soft irq handler.  Timer base list is protected
by a spinlock. After a timer is removed from the list, __run_timers()
won't triggers it any more.

Does I miss something here?

Thanks

Sonic
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help