Re: [PATCH v8] tty: tty_port: add workqueue to flip TTY buffer

From: Xin Zhao

Date: Tue Dec 30 2025 - 04:04:28 EST


Hi all,

On Tue, 23 Dec 2025 11:48:36 +0800 Xin Zhao <jackzxcui1989@xxxxxxx> wrote:
> On the embedded platform, certain critical data, such as IMU data, is
> transmitted through UART. The tty_flip_buffer_push() interface in the TTY
> layer uses system_dfl_wq to handle the flipping of the TTY buffer.
> Although the unbound workqueue can create new threads on demand and wake
> up the kworker thread on an idle CPU, it may be preempted by real-time
> tasks or other high-prio tasks.
>
> flush_to_ldisc() needs to wake up the relevant data handle thread. When
> executing __wake_up_common_lock(), it calls spin_lock_irqsave(), which
> does not disable preemption but disables migration in RT-Linux. This
> prevents the kworker thread from being migrated to other cores by CPU's
> balancing logic, resulting in long delays. The call trace is as follows:
>
> ...


Are there any other changes needed before the patch is merged?

Jiri has reviewed the patch, and I have made the modifications. :)

--
Xin Zhao