Re: [patch 1/2] epoll fix own poll()

From: Davide Libenzi
Date: Fri Jan 30 2009 - 13:41:25 EST


On Fri, 30 Jan 2009, Pavel Pisa wrote:

> I have seen the reason exactly when I have sent the e-mail
> and switched computer off at the night.
>
> The reason is simple and it is caused by debugging print in each
> loop in my application and by way how poll concept is implemented
> in the kernel.

Yes, this is a known thing. Like I already told you yesterday, calling it
a "spurious" event. So you code *is* generating a spurios event to the
tty, with a write.
Unfortunately this is how Linux poll subsystem works. But things can be
improved, w/out any revolution.
I already have patches to send Andrew-ward, that (gradually) uses the
wakeup "key" to report event that really happened, during the wakeup call.
This will allow the epoll callback to avoid epoll waiters wakeups, when
events do not match the interest mask.


- Davide

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/