Re: [PATCH v3] tty: tty_port: add workqueue to flip tty buffer
From: Tejun Heo
Date: Wed Nov 26 2025 - 11:37:49 EST
On Wed, Nov 26, 2025 at 10:46:50PM +0800, Xin Zhao wrote:
> On Wed, 26 Nov 2025 13:10:49 +0100 Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
>
> > I don't know, what have you found in your testing? Will multiple
> > workqueues cause too much overhead for large multi-port systems (i.e.
> > modem banks?)
> >
> > Perhaps start with just a single workqueue and then increase it if there
> > is contention later if people notice?
>
> OK. I will allocate single workqueue of one tty_driver in v4, simplifying
> the logic for creating and releasing the workqueue.
Note that having multiple workqueues doesn't necessarily mean there will be
more threads. If you have 10 workqueues with @max_active of 1, you'd get the
same concurrency as a single workqueue with @max_active of 10. Each
workqueue is more of a property domain than actual thread pool. I don't
think you'd gain anything by creating a separate workqueue per device.
Thanks.
--
tejun