All of lore.kernel.org
 help / color / mirror / Atom feed
* [bisected] pty performance problem
@ 2009-11-21 22:23 Robert Swan
  2009-11-21 23:23 ` Alan Cox
                   ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: Robert Swan @ 2009-11-21 22:23 UTC (permalink / raw)
  To: linux-kernel

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

the git log says:
! commit d945cb9cce20ac7143c2de8d88b187f62db99bdc
! Author: Alan Cox <alan@linux.intel.com>
! Date:   Tue Jul 7 16:39:41 2009 +0100
! 
!     pty: Rework the pty layer to use the normal buffering logic
!     
!     This fixes the ppp problems and various other issues with call locking
!     caused by one side of a pty called in one locking context trying to match
!     another with differing rules on the other side. We also get a big slack
!     space to work with that means we can bury the flow control deadlock case
!     for any conceivable real world situation.
!     
!     Signed-off-by: Alan Cox <alan@linux.intel.com>
!     Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

I can provide reasonably stripped down code which demonstrates the
problem.  It has been reproduced by one other person, though his delay
was about 2ms.

Have fun,

Rob.

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2011-07-09  6:30 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-21 22:23 [bisected] pty performance problem Robert Swan
2009-11-21 23:23 ` Alan Cox
2009-11-22  0:27   ` Robert Swan
2009-11-22 12:29     ` Alan Cox
2009-11-22 12:41       ` Mike Galbraith
2009-11-22 21:37       ` Robert Swan
2009-11-22  6:39 ` Ingo Molnar
2009-11-22  7:15   ` Arjan van de Ven
2009-11-22 21:56     ` Robert Swan
2009-11-22 12:23   ` Alan Cox
2009-11-22 12:42     ` Ingo Molnar
2009-11-23  5:00     ` Mike Galbraith
2009-11-23 10:28       ` Alan Cox
2009-11-23 11:31       ` Alan Cox
2009-11-23 11:48         ` Ingo Molnar
2009-11-23 11:59           ` Alan Cox
2009-11-23 12:04             ` Ingo Molnar
2009-11-23 13:34               ` Alan Cox
2009-11-23 17:48                 ` Ingo Molnar
2011-07-09  6:29 ` Robert Swan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.