Re: [PATCH net-next 0/5] implement kthread based napi poll
From: Jakub Kicinski <kuba@kernel.org>
Date: 2020-09-30 20:08:43
On Wed, 30 Sep 2020 12:21:35 -0700 Wei Wang wrote:
With napi poll moved to kthread, scheduler is in charge of scheduling both the kthreads handling network load, and the user threads, and is able to make better decisions. In the previous benchmark, if we do this and we pin the kthreads processing napi poll to specific CPUs, scheduler is able to schedule user threads away from these CPUs automatically. And the reason we prefer 1 kthread per napi, instead of 1 workqueue entity per host, is that kthread is more configurable than workqueue, and we could leverage existing tuning tools for threads, like taskset, chrt, etc to tune scheduling class and cpu set, etc. Another reason is if we eventually want to provide busy poll feature using kernel threads for napi poll, kthread seems to be more suitable than workqueue.
As I said in my reply to the RFC I see better performance with the workqueue implementation, so I would hold off until we have more conclusive results there, as this set adds fairly strong uAPI that we'll have to support for ever.