Re: [PATCH v1 3/3] drivers/tty: increase priority for tty_buffer_worker

From: Oleksij Rempel
Date: Thu Jan 10 2019 - 10:20:00 EST


On Thu, Jan 10, 2019 at 04:54:53AM -0800, Linus Torvalds wrote:
> On Thu, Jan 10, 2019 at 2:12 AM Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx> wrote:
> >
> > sched_priority = 1 is enough to dramatically reduce latency
> > on have system load produced by tasks with default user space prio.
>
> .. and is this perhaps a way for a user to then make the system spend
> inordinate amounts of time in the tty layer, and hurting other people?
> I'm thinking threads using pty's etc as a way to make the system
> unresponsive.
>
> We have *never* had good results with random priority modifications.
> People used to do this for the X server, and it helped in very
> specific cases, and hurt enormously in others.
>
> Why would anybody use a tty interface with a l;oopback adapter and
> care about latency?
>
> I can kind of see why you want to do this from a theoretical point,
> but from a *practical* point of view it seems pointless. Why not use
> more appropriate models like networking or pipes etc. IOW, I think you
> should describe what you *really* are doing much more.
>
> "hackbench with a loopback serial adapter" really doesn't sound like
> something that should worry a lot of people.

yes, you right.

> My gut feel is that if somebody still cares deeply about serial line
> latency, they should look at trying to see if they can do some of the
> work directly without the bounce to the workqueue. We use workqueues
> for a reason, but it's possible that some of it could be avoided at
> least in special cases... And yours sounds like a special case.

It is for industrial low latency RS-422 based application. The loopback
test is just easy way to test/reproduce it without additional hardware.

What is good, mainlineable way to implement it?

--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |