public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrea Arcangeli <andrea@suse.de>
To: dak@gnu.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: Scheduling problem with 2.4?
Date: Sat, 17 May 2003 23:53:45 +0200	[thread overview]
Message-ID: <20030517215345.GA1429@dualathlon.random> (raw)
In-Reply-To: <x565o9717j.fsf@lola.goethe.zz>

On Sat, May 17, 2003 at 10:44:16PM +0200, David Kastrup wrote:
> Which kernel?  Oh, and of course: on a SMP machine the problem would

I run it on smp. but I understood what's going on.

--- testio.el.orig	2003-05-17 22:22:24.000000000 +0200
+++ testio.el	2003-05-17 23:39:49.000000000 +0200
@@ -19,7 +19,7 @@
   (setq test-pattern nil test-start (float-time))
   (let ((process (start-process
 		  "test" (and (bufferp printer) printer) "sh"
-		  "-c" "od -v /dev/zero|dd bs=1 count=100k")))
+		  "-c" "od -v /dev/zero| dd bs=100k count=1")))
     (set-process-filter process `(lambda (process string)
 				   (test-filter process string
 						',printer)))


this is what I thought you were really doing with this script, not the
other way around ;).

The reason you get the 1 char reads in your version is because dd will
only write 1 char at time to emacs. This has nothing to do with emacs,
this is about dd writing 1 char at time. If you don't write 1 char at
time, emacs won't read 1 char at time.

The only thing you could do to decrease the cxt switch flood is to put a
buffer with timeout in between, but by default having a buffer with
timeout in the kernel would be an overkill overhead and depending on the
timeout it could be visible for normal shells. So the kernel behaviour
is right and it isn't going to change.

If one important app of yours is dumb and writes flood of data 1 char at
time then just write a buffer in userspace yourself, and in 99% of cases
a dd bs=4k will just work perfectly (you'll need a timeout-stdout-flush
version one only if the pipe keeps staying open i.e. if the app doesn't
quit).

Andrea

  reply	other threads:[~2003-05-17 21:40 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030517215345.GA1429@dualathlon.random \
    --to=andrea@suse.de \
    --cc=dak@gnu.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox