[PATCH/RFC 1/2] optimization updating timer in connection tracking

Pablo Neira pablo at eurodev.net
Mon Sep 20 14:27:08 CEST 2004


Patrick McHardy escribió:

> We can't use mod_timer because it will re-add a timer that
> already went off and dropped it's reference count to the conntrack.
> mod_timer is equivalent to del_timer(); add_timer(); but we do
> del_timer() && add_timer();


thanks for the hint, in that case, is it worthy adding something like

----- from kernel/timer.c  ----
261         /*
262          * This is a common optimization triggered by the
263          * networking code - if the timer is re-modified
264          * to be the same thing then just return:
265          */
266         if (timer->expires == expires && timer_pending(timer))
267                 return 1;
----- end -------

inside the write_lock section?

regards,
Pablo



More information about the netfilter-devel mailing list