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 Jan 23, 2020, at 10:37 PM, Jason Thorpe <thorpej%me.com@localhost> wrote:
> 
> Callouts are a bit more expensive... to arm them or introspect them requires taking an additional lock **shared by other callouts** that could be a source of lock contention; my proposal has the txtimer protected by the txq lock that would already be held in a NET_MPSAFE driver, and arming is just a 64-bit relaxed atomic load (yes, I know this would require a slightly more expensive operation on 32-bit machines), an unprotected 64-bit store, and an unprotected store of a bool (these unprotected stores are actually protected by the txq lock; I call them "unprotected" because they themselves don't requite atomicity or ordering). This could make a difference when you're trying to blast out packets at 40Gb/s.

Another point that occurred to me as I was walking out to my car this morning... it doesn't have to be a 64-bit load...  Under the covers, it's using time_uptime ... but I see very little reason why time_uptime has to be a time_t.  A 32-bit number is sufficient to count ~136 years of uptime.

-- thorpej



Home | Main Index | Thread Index | Old Index