On Thu, Oct 05, 2023 at 11:09:52AM -0500, Scott Cheloha wrote: > On Thu, Oct 05, 2023 at 12:57:24AM +0200, Alexander Bluhm wrote: > > > > This is a first step to unlock TCP syn cache. The timer function > > is independent of the socket code. That makes it easy to start > > there. > > > > [...] > > > > Still missing: > > - [...] > > - Run timer without kernel lock. I am not aware of such a feature. > > There is already some network code that could benefit from that. > > Can we get timer without kernel lock like TASKQ_MPSAFE implements > > it for tasks? > > This patch adds a TIMEOUT_MPSAFE flag for use with TIMEOUT_PROC. > Softint timeouts are a different story. > > To run syn_cache_timer() without the kernel lock you would initialize > it like this: > > timeout_set_flags(&sc->sc_timer, syn_cache_timer, sc, KCLOCK_NONE, > TIMEOUT_PROC | TIMEOUT_MPSAFE); > > Use with caution, this needs another set of eyes. >
I don't like that softclock_thread() mixes kernel locked and mpsafe timers processing. Could you use separate threads for them?