atom feed46 messages in org.kernel.vger.linux-kernelRe: tty: add 'active' sysfs attribute...
FromSent OnAttachments
Kay SieversNov 16, 2010 7:46 am 
Alan CoxNov 16, 2010 7:56 am 
Kay SieversNov 16, 2010 8:12 am 
Alan CoxNov 16, 2010 9:14 am 
Kay SieversNov 16, 2010 10:51 am 
Alan CoxNov 16, 2010 11:55 am 
Kay SieversNov 16, 2010 12:15 pm 
Alan CoxNov 16, 2010 12:48 pm 
Kay SieversNov 16, 2010 1:28 pm 
Lennart PoetteringNov 16, 2010 1:35 pm 
Lennart PoetteringNov 16, 2010 1:42 pm 
Alan CoxNov 16, 2010 2:51 pm 
Alan CoxNov 16, 2010 2:55 pm 
Lennart PoetteringNov 16, 2010 2:58 pm 
Alan CoxNov 16, 2010 3:04 pm 
Lennart PoetteringNov 16, 2010 3:10 pm 
Lennart PoetteringNov 16, 2010 3:18 pm 
Alan CoxNov 16, 2010 3:45 pm 
Etched PixelsNov 16, 2010 3:49 pm 
John StoffelNov 17, 2010 8:31 am 
Vald...@vt.eduNov 17, 2010 2:00 pm 
Kay SieversNov 17, 2010 3:39 pm 
Alan CoxNov 17, 2010 3:56 pm 
Greg KHNov 17, 2010 5:27 pm 
Lennart PoetteringNov 17, 2010 5:48 pm 
Greg KHNov 17, 2010 5:52 pm 
Lennart PoetteringNov 17, 2010 6:28 pm 
Alan CoxNov 18, 2010 2:14 am 
Dr. Werner FinkNov 18, 2010 2:59 am 
Alan CoxNov 18, 2010 3:23 am 
Kay SieversNov 18, 2010 3:54 am 
Kay SieversNov 18, 2010 4:03 am 
Dr. Werner FinkNov 18, 2010 4:12 am 
Alan CoxNov 18, 2010 4:57 am 
Alan CoxNov 18, 2010 5:00 am 
Dr. Werner FinkNov 18, 2010 5:13 am 
Alan CoxNov 18, 2010 6:41 am 
Dr. Werner FinkNov 19, 2010 5:21 am 
Alan CoxNov 19, 2010 7:46 am 
Dr. Werner FinkNov 19, 2010 9:06 am.tiocgdev
Greg KHNov 19, 2010 10:02 am 
Dr. Werner FinkNov 19, 2010 10:41 am 
Alan CoxNov 20, 2010 4:39 am 
Dr. Werner FinkDec 1, 2010 3:15 am 
Dr. Werner FinkDec 1, 2010 4:31 am.tiocgdev
Dr. Werner FinkDec 3, 2010 3:47 am.Other
Subject:Re: tty: add 'active' sysfs attribute to tty0 and console device
From:Lennart Poettering (mzxr@0pointer.de)
Date:Nov 16, 2010 1:35:59 pm
List:org.kernel.vger.linux-kernel

On Tue, 16.11.10 19:55, Alan Cox (al@lxorguk.ukuu.org.uk) wrote:

we always will apply the final result just fine, when stuff stops changing. It's actually a nice feature and no a problem at all, that we only see the most recent state.

Stuff never stops changing until the machine shuts down, its undefined.

Sure, with the ioctl() we've seen many not interesting changes, but we often miss the single one that is important -- the last last one. The thing is that we don't need to sleep here and miss changes.

So we fix the ioctl interface, it's not exactly hard to do now is it.

Sorry, the WAITEVENT stuff interface you created is unusably broken:

a) it's a sleeping ioctl which makes it unusable in anything but the most trivial applications, because most programs need to respond to more than once wakeup event. Of course, you can then introduce threads but that's horrible.

b) It loses events, because events that happen after you woke up and before you go back into WAITEVENT are completely lost. And those events might actually be relevant, since they might be the most recent events that happened. And those tend to be ones that matter.

Kay's interface also drops events, but only historic events that happened but aren't current anymore. And that's a good thing, because when you track which VT is in the foreground for presentation, or for permission management purposes then you care little of who else should have had access in the past but didn't get it. You are only interested in the most recent update, which is what Kay's interface gives you.

Kay's interface is not intended to be useful for logging purposes. It is useful to track VT changes for service activation, for permission management.

It's a straight-forward and simple text interface that does all we need to track console and vt changes.

Except that it doesn't address things like the permissions side of things.

Well, the suff it provides is purely informational. You cannot actually influence the TTY in anyway, you can just watch which VT is currently active.

I don't think that information should be protected more than necessary. If

"We have an interface that doesn't quite work for our case and we think that is a bug" is not the reasoning behind writing a new random one with a totally disconnected permission model that doesn't work either.

I am sorry, but WAITEVENT doesn't work for *any* case. It is completely broken. Have you actually ever tried to use it yourself? Do it. Write me a race-free program with it that tracks VT switches and i'd be amazed!

Fix the one we have.

Well, to fix the existing one, you'd a) have to turn it into something with a pollable fd, and b) something that doesn't lose current events. And voila, you'll have created Kay's interface.

Lennart