Re: [PATCH 1/3] powerpc: Make rtas console _much_ faster



I'll clean this one up a little before merging it as per Ryan's email of
a week or two ago. New patch today or tomorrow.

Even though this is 1/3 the rest of the series should be fine to merge,
right Arnd?

cheers

On Sat, 2006-04-29 at 02:45 +0200, Arnd Bergmann wrote:
Currently the hvc_rtas driver is painfully slow to use. Our "benchmark" is
ls -R /etc, which spits out about 27866 characters. The theoretical maximum
speed would be about 2.2 seconds, the current code takes ~50 seconds.

The core of the problem is that sometimes when the tty layer asks us to push
characters the firmware isn't able to handle some or all of them, and so
returns an error. The current code sees this and just returns to the tty code
with the buffer half sent.

There's the khvcd thread which will eventually wake up and try to push more
characters, that will usually work because the firmware's had time to push
the characters out. But the thread only wakes up every 10 milliseconds, which
isn't fast enough.

There's already code in the hvc_console driver to make the khvcd thread do
a "quick" loop, where it just calls yield() instead of sleeping. The only code
that triggered that behaviour was recently removed though, which I don't
quite understand.

Still, if we set HVC_POLL_QUICK whenever the push hvc_push() doesn't push all
characters (ie. RTAS blocks), we can get good performance out of the hvc_rtas
backend. With this patch the "benchmark" takes ~2.8 seconds.

Cc: Ryan Arnold <rsa@xxxxxxxxxx>
Signed-off-by: Michael Ellerman <michael@xxxxxxxxxxxxxx>
Signed-off-by: Arnd Bergmann <arnd.bergmann@xxxxxxxxxx>

---

drivers/char/hvc_console.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Index: linus-2.6/drivers/char/hvc_console.c
===================================================================
--- linus-2.6.orig/drivers/char/hvc_console.c
+++ linus-2.6/drivers/char/hvc_console.c
@@ -570,7 +570,7 @@ static int hvc_poll(struct hvc_struct *h
hvc_push(hp);
/* Reschedule us if still some write pending */
if (hp->n_outbuf > 0)
- poll_mask |= HVC_POLL_WRITE;
+ poll_mask |= HVC_POLL_WRITE | HVC_POLL_QUICK;

/* No tty attached, just skip */
tty = hp->tty;

--
--
Michael Ellerman
IBM OzLabs

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

Attachment: signature.asc
Description: This is a digitally signed message part



Relevant Pages

  • Re: [PATCH 0.01/1] hlist_for_each_entry_xxx: kill the "pos" argument
    ... the patch for the code above is ... push @$v_list, $1; ... push @SRC, $comm; ... diff_file for @ARGV; ...
    (Linux-Kernel)
  • Re: tcsh backtick hang info
    ... This will be the official patch, and yes I have another 9 bug fixes since ... On ancient 7 bit locales, punctuation characters are used to ... Fix pty detection logic of tcsh autologout initialization. ...
    (freebsd-current)
  • [PATCH] EXTPROC, telnetd LINEMODE, revisited
    ... If ICANON is set then the tty driver will parse ... already fully processed on the client, any control characters remaining in the ... My previous patch had a collision in the TIOCSIG ioctl command number, obviously other ioctls had gotten added in the intervening years. ...
    (Linux-Kernel)
  • Re: distribution points
    ... It is mostly when trying to push a patch out at log on, ... > process from site server to client install, and maybe we can tune some of ... >> rights. ...
    (microsoft.public.sms.misc)
  • Re: tcsh backtick hang info
    ... | Thanks for the good words, Christos! ... This will be the official patch, and yes I have another 9 bug fixes since ... On ancient 7 bit locales, punctuation characters are used to ...
    (freebsd-current)