System is flooded with failed read(2) calls: Resource
temporarily unavailable (errno=35) coming from xorg unix socket
Yuri
yuri at rawbw.com
Sun Jul 1 20:11:28 UTC 2012
On 07/01/2012 08:57, Adrian Chadd wrote:
> I haven't yet done digging to see if poll() is returning the xorg
> socket as being ready. I think that's worth doing.
>
> And it's a huge problem for battery consumption.:)
For simple qt4 apps, reads in question originate from libxcb from
_xcb_in_read function.
I tried to replace read with poll in there but poll just blocks:
//int n = read(c->fd, c->in.queue + c->in.queue_len,
sizeof(c->in.queue) - c->in.queue_len);
struct pollfd fds = {c->fd, POLLIN|POLLERR|POLLHUP, INFTIM};
int n = poll(&fds, 1, INFTIM);
poll hangs during the third call in simple test app, because
poll_for_response is called during XFlush when it is nothing to actually
read.
So some of libX11 code should be changed to only call poll when response
is expected.
Otherwise it looks like poll indeed returns xorg socket as being ready.
Yuri
More information about the freebsd-hackers
mailing list