Re: [bisected] pty performance problem

From: Robert Swan
Date: Sat Jul 09 2011 - 02:30:17 EST


On Sun, Nov 22, 2009 at 09:23:19AM +1100, Robert Swan wrote:
> I posted this to the kernel-newbies list, but have graduated to the
> adults forum:
>
> ! Two C programs are having a query-response conversation through a
> ! pseudo terminal:
> !
> ! A (client) -- forever { send query; read response }
> ! B (server) -- forever { read query; send response }
> !
> ! Neither has any I/O apart from the pty conversation, so I'd expect to
> ! see CPU usage at 100%. When I ran it, the CPU was pretty well idle.
> ! After a fair bit of fiddling, it turned out that both sides were
> ! taking about 8ms for their read() calls. At that point it seemed
> ! pretty clear that this was a delay in the kernel, not the code.
> !
> [snip]
>
> 2.6.31-rc2-00205-gb4b21ca good
> 2.6.31-rc2-00206-gd945cb9 bad
>
> and still bad with the latest: 2.6.32-rc8-00011-ga8a8a66

And still bad with the 2.6.37 release.

I have been using a workaround happily enough, so I'm not nagging.
18 months hardly rates as nagging frequency, possibly sniping, but I'm
not doing that either. I tried my test case for the first time in
ages today and thought a reminder was merited in case it had slipped
between the cracks.

I'll attach the test code, since I didn't post that to the list last
time.

Have fun,

Rob.

Attachment: ptytst.tgz
Description: GNU Unix tar archive