public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Scheduling problem with 2.4?
@ 2003-05-17 11:22 David Kastrup
  2003-05-17 17:41 ` Andrea Arcangeli
  0 siblings, 1 reply; 20+ messages in thread
From: David Kastrup @ 2003-05-17 11:22 UTC (permalink / raw)
  To: linux-kernel


I have a problem with Emacs which crawls when used as a shell.  If I
call M-x shell RET and then do something like
hexdump -v /dev/null|dd count=100k bs=1
then characters appear rather slowly at first, most of them in single
character packets, with an occasional 1024 packet in between.  More
of them at the end.  The rate of the packets does not exceed 100/sec.

Other operating systems do not exhibit this extreme case of
throttling.  Emacs is using select calls AFAICS for dealing with
packets arriving, and it would appear that the delivering process
causes a context switch immediately when writing its single byte to
the pipe or is taken from the run queue while the select call is
pending.  Whatever.  In the ensuing time slice, Emacs processes the
single arriving byte and then enters the select call again.

Now that the pipe is not allowed to fill up in most cases (most: in
some, increasingly more at the later time, the pipe gets filled
alternately complete and with single bytes) before a context switch
occurs is already unfortunate with regard to the efficiency of
processing.  What is quite more of a nuisance is the apparent
throttling to a single byte per clock tick: the CPU is idling most of
the time.  It would be unfortunate enough if it were going full blast
at processing 1-byte packets, but most of the time it does nothing
but wait for the next tick.

Now I would want to

a) get sufficient information about what might go wrong inside of
Linux as compared to other operating systems.

b) find a good workaround for not triggering this kind of behavior.

I don't have sufficient kernel experience to debug this one, and it
definitely impacts the speed of operations severely, and in close
cooperation with the operating system.  So any pointers would be
welcome.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

end of thread, other threads:[~2003-05-19  6:58 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-17 11:22 Scheduling problem with 2.4? David Kastrup
2003-05-17 17:41 ` Andrea Arcangeli
2003-05-17 19:36   ` David Kastrup
2003-05-17 20:30     ` Andrea Arcangeli
2003-05-17 20:44       ` David Kastrup
2003-05-17 21:53         ` Andrea Arcangeli
2003-05-17 22:37           ` David Kastrup
2003-05-17 23:50             ` Andrea Arcangeli
2003-05-18  0:16               ` David Schwartz
2003-05-18  1:06                 ` Andrea Arcangeli
2003-05-18  9:41                   ` David Kastrup
2003-05-18  8:55                 ` Mike Galbraith
2003-05-18 17:46                   ` David Schwartz
2003-05-18 23:18                     ` Andrea Arcangeli
2003-05-19  2:59                       ` David Schwartz
2003-05-18 23:11                   ` Andrea Arcangeli
2003-05-19  7:16                     ` Mike Galbraith
2003-05-19  4:02                   ` Mike Galbraith
2003-05-18  0:24               ` David Kastrup
2003-05-17 21:54         ` Barry K. Nathan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox