Re: [PATCH 29/49] vcs: add poll/fasync support

From: Nicolas Pitre
Date: Tue Nov 09 2010 - 20:28:41 EST


On Wed, 10 Nov 2010, Kay Sievers wrote:

> On Fri, Oct 22, 2010 at 20:21, Greg Kroah-Hartman <gregkh@xxxxxxx> wrote:
> > From: Nicolas Pitre <nico@xxxxxxxxxxx>
> >
> > The /dev/vcs* devices are used, amongst other things, by accessibility
> > applications such as BRLTTY to display the screen content onto refreshable
> > braille displays. ÂCurrently this is performed by constantly reading from
> > /dev/vcsa0 whether or not the screen content has changed. ÂGiven the
> > default braille refresh rate of 25 times per second, this easily qualifies
> > as the biggest source of wake-up events preventing laptops from entering
> > deeper power saving states.
> >
> > To avoid this periodic polling, let's add support for select()/poll() and
> > SIGIO with the /dev/vcs* devices. ÂThe implemented semantic is to report
> > data availability whenever the corresponding vt has seen some update after
> > the last read() operation. ÂThe application still has to lseek() back
> > as usual in order to read() the new data.
>
> Shouldn't it raise POLLPRI/POLLERR then, when it's not about new data
> to read? We do this for several files in the kernel where we just want
> to wakup someone, but the pretty well-defined semantics of poll()
> don't apply.

Hmmm... Maybe POLLPRI, but POLLERR makes no sense.


Nicolas