aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/hvc_console.c
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2006-06-07 03:10:03 -0400
committerPaul Mackerras <paulus@samba.org>2006-06-09 07:24:18 -0400
commitb53744612f276ad20c5d7ef33ac991ec13101417 (patch)
tree937dbded1be6edd989e325fbc9b803931946c7f5 /drivers/char/hvc_console.c
parente9370ae15dc2f8ba1e1889ce26f13cda565b6ecb (diff)
[PATCH] powerpc: Make rtas console _much_ faster
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. The khvcd thread will eventually wake up and try to push more characters, which will usually work because by then the firmware's had time to make room. But the khvcd thread only wakes up every 10 milliseconds, which isn't fast enough. So change the khvcd thread logic so that if there's an incomplete write we yield() and then immediately try writing again. Doing so makes POLL_QUICK and POLL_WRITE synonymous, so remove POLL_QUICK. With this patch our "benchmark" takes ~2.8 seconds. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'drivers/char/hvc_console.c')
-rw-r--r--drivers/char/hvc_console.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c
index 2b6a56b2bf35..a5c6a9d7ff08 100644
--- a/drivers/char/hvc_console.c
+++ b/drivers/char/hvc_console.c
@@ -553,7 +553,6 @@ static int hvc_chars_in_buffer(struct tty_struct *tty)
553 553
554#define HVC_POLL_READ 0x00000001 554#define HVC_POLL_READ 0x00000001
555#define HVC_POLL_WRITE 0x00000002 555#define HVC_POLL_WRITE 0x00000002
556#define HVC_POLL_QUICK 0x00000004
557 556
558static int hvc_poll(struct hvc_struct *hp) 557static int hvc_poll(struct hvc_struct *hp)
559{ 558{
@@ -568,6 +567,7 @@ static int hvc_poll(struct hvc_struct *hp)
568 /* Push pending writes */ 567 /* Push pending writes */
569 if (hp->n_outbuf > 0) 568 if (hp->n_outbuf > 0)
570 hvc_push(hp); 569 hvc_push(hp);
570
571 /* Reschedule us if still some write pending */ 571 /* Reschedule us if still some write pending */
572 if (hp->n_outbuf > 0) 572 if (hp->n_outbuf > 0)
573 poll_mask |= HVC_POLL_WRITE; 573 poll_mask |= HVC_POLL_WRITE;
@@ -680,7 +680,7 @@ int khvcd(void *unused)
680 poll_mask |= HVC_POLL_READ; 680 poll_mask |= HVC_POLL_READ;
681 if (hvc_kicked) 681 if (hvc_kicked)
682 continue; 682 continue;
683 if (poll_mask & HVC_POLL_QUICK) { 683 if (poll_mask & HVC_POLL_WRITE) {
684 yield(); 684 yield();
685 continue; 685 continue;
686 } 686 }