lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250425194742.735890ac@kernel.org>
Date: Fri, 25 Apr 2025 19:47:42 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Joe Damato <jdamato@...tly.com>
Cc: Samiullah Khawaja <skhawaja@...gle.com>, "David S . Miller"
 <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Paolo Abeni
 <pabeni@...hat.com>, almasrymina@...gle.com, willemb@...gle.com,
 mkarsten@...terloo.ca, netdev@...r.kernel.org
Subject: Re: [PATCH net-next v5] Add support to set napi threaded for
 individual napi

On Fri, 25 Apr 2025 19:34:52 -0700 Joe Damato wrote:
> On Fri, Apr 25, 2025 at 05:37:43PM -0700, Jakub Kicinski wrote:
> > On Fri, 25 Apr 2025 15:52:30 -0700 Samiullah Khawaja wrote:  
> > > I think the reason behind it not being killed is because the user
> > > might have already done some configuration using the PID and if the
> > > kthread was removed, the user would have to do that configuration
> > > again after enable/disable. But I am just speculating. I will let the
> > > maintainers weigh-in as you suggested.  
> > 
> > I haven't looked at the code, but I think it may be something more
> > trivial, namely that napi_enable() return void, so it can't fail.
> > Also it may be called under a spin lock.  
> 
> If you don't mind me asking: what do you think at a higher level
> on the discussion about threaded NAPI being disabled?
> 
> It seems like the current behavior is:
>   - If you write 1 to the threaded NAPI sysfs path, kthreads are
>     kicked off and start running.
> 
>   - If you write 0, the threads are not killed but don't do any
>     processing and their pids are still exported in netlink.
> 
> I was arguing in favor of disabling threading means the thread is
> killed and the pid is no longer exported (as a side effect) because
> it seemed weird to me that the netlink output would say:
> 
>    pid: 1234
>    threaded: 0
> 
> In the current implementation.

We should check the discussions we had when threaded NAPI was added.
I feel nothing was exposed in terms of observability so leaving the
thread running didn't seem all that bad back then. Stopping the NAPI
polling safely is not entirely trivial, we'd need to somehow grab
the SCHED bit like busy polling does, and then re-schedule.
Or have the thread figure out that it's done and exit.
Probably easier to hide the attr in netlink.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ