tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: if_txtimer API to replace (*if_watchdog)()



On Thu, Jan 23, 2020 at 07:23:46AM -0800, Jason Thorpe wrote:

> 
> > On Jan 23, 2020, at 6:28 AM, Jason Thorpe <thorpej%me.com@localhost> wrote:
> > 
> >> We need to teach if_txtimer_tick not to call callout_schedule
> >> somehow on destruction, otherwise if_txtimer_tick can continue
> >> to run even after calling callout_halt.  wm avoids the flaw by
> >> checking sc_core_stopping at the beginning of wm_tick.
> > 
> > This is a general problem in all drivers that use callouts, and if_txtimer_tick() doesn't really make it any worse than existing drivers that use tick callouts themselves.  I think even wm(4)'s approach has a problem in the detach case.  I have some thoughts on how to solve this problem generally, and will attack this problem at a future time.
> 
> Oh!  I just realized that I missed the point you were making here.  I see what you mean now, and I will address it.  But my other statements about callouts is also true :-)

This might do it, I think it's definitely needed for the destroy/detach use
case:

	http://www.netbsd.org/~ad/2020/kern_timeout.c.diff

The callout_stop/halt thing is an endless source of work.

Andrew


Home | Main Index | Thread Index | Old Index