Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 01 Jul 2012 13:11:13 -0700
From:      Yuri <yuri@rawbw.com>
To:        Adrian Chadd <adrian@freebsd.org>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: System is flooded with failed read(2) calls: Resource temporarily unavailable (errno=35) coming from xorg unix socket
Message-ID:  <4FF0AEE1.5040607@rawbw.com>
In-Reply-To: <CAJ-Vmo=NVQSDoP0JFGNmCyo9O%2BrZ_J4G7TxWXq4Tmwz=tDwmEw@mail.gmail.com>
References:  <4FEE0D2F.4010808@rawbw.com> <CAJ-Vmo=NVQSDoP0JFGNmCyo9O%2BrZ_J4G7TxWXq4Tmwz=tDwmEw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4FF0AEE1.5040607>