[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAGK4HS8SoXAGM-zgbofQp+Cy19Z0doQafvYceePt_kM9CEchYQ@mail.gmail.com>
Date: Fri, 8 Nov 2013 13:59:19 -0800
From: Vijay Subramanian <subramanian.vijay@...il.com>
To: David Miller <davem@...emloft.net>
Cc: netdev <netdev@...r.kernel.org>,
Stephen Hemminger <shemminger@...tta.com>,
Eric Dumazet <eric.dumazet@...il.com>
Subject: Re: [PATCH net] net: sch_red: Fix race between timer and red_destroy()
> del_timer_sync() waits for all instances of the timer handler which
> are running to complete, and then it deletes the timer from any of
> the scheduled timer lists.
>
> Your patch is making the mod_timer() in the timer handler conditional,
> and this really shouldn't be necessary.
>
> The whole point of del_timer_sync() is to address these kinds of
> situations.
Thanks for the explanation Dave. I am trying to reconcile your
explanation with the text above del_timer_sync()
vim +1013 kernel/timer.c
" * This function only differs from del_timer() on SMP: besides deactivating
* the timer it also makes sure the handler has finished executing on other
* CPUs.
*
* Synchronization rules: Callers must prevent restarting of the timer,
* otherwise this function is meaningless. ..."
This seems to suggest simply calling del_timer_sync() is not enough.
In fact, for the same reason I was recently pointed towards
commit 980c478ddbb72 (sch_sfq: use del_timer_sync() in sfq_destroy() )
and I based the patch on how q->perturb_period is reset in
sfq_destroy() and used in sfq_perturbation().
Based on your explanation , I think we do not need (in sched/sch_sfq.c)
q->perturb_period = 0; in sfq_destroy() and just del_timer_sync()
should be enough.
Thanks,
Vijay
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists