mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [Patch] Peformance improvement of serial console via virtual serial port
@ 2005-09-06  2:09 Taku Izumi
  0 siblings, 0 replies; only message in thread
From: Taku Izumi @ 2005-09-06  2:09 UTC (permalink / raw)
  To: linux-kernel; +Cc: Russell King

Greetings.

This patch improves peformance of serial console by using FIFO.
I think original serial driver is not effective, but transfer rate of
real serial port is low, so this problem has not been exposed.

However, because transfer rate of virtual serial port (ex. Serial Over
Ethernet)
is higher than that of real serial port, this problem is exposed.
The output performance via virtual serial port is still low by using original
serial driver. I think original serial driver becomes bottoleneck.


Taku Izumi <izumi2005@soft.fujitsu.com>

----------patch-------->8----------------------------------------

diff -Npur linux-2.6.9.org/drivers/serial/8250.c
linux-2.6.9/drivers/serial/8250.c
--- linux-2.6.9.org/drivers/serial/8250.c       2005-08-08
11:17:38.556373366 +0900
+++ linux-2.6.9/drivers/serial/8250.c   2005-08-08 11:41:03.759131389 +0900
@@ -1943,18 +1943,33 @@ serial8250_console_write(struct console
        /*
         *      Now, do each character
         */
-       for (i = 0; i < count; i++, s++) {
-               wait_for_xmitr(up);
+       for (i = 0; i < count; ) {
+               int     fifo ;

+               wait_for_xmitr(up);
+               fifo = up->tx_loadsz ;
                /*
-                *      Send the character out.
+                *      Send the character out using FIFO.
                 *      If a LF, also do CR...
                 */
-               serial_out(up, UART_TX, *s);
-               if (*s == 10) {
-                       wait_for_xmitr(up);
-                       serial_out(up, UART_TX, 13);
-               }
+               do {
+                       serial_out(up, UART_TX, *s);
+                       fifo-- ;
+                       if (*s == 10) {
+                               if (fifo > 0) {
+                                       serial_out(up, UART_TX, 13);
+                                       fifo--;
+                               } else {
+                                       /* No room to add CR */
+                                       wait_for_xmitr(up);
+                                       fifo = up->tx_loadsz ;
+                                       serial_out(up, UART_TX, 13);
+                                       fifo--;
+                               }
+                       }
+                       i++ ;
+                       s++ ;
+               } while (fifo > 0 && i < count ) ;
        }

        /*
----------------------------------------------------------------------



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-09-06  2:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-06  2:09 [Patch] Peformance improvement of serial console via virtual serial port Taku Izumi

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

all inboxes | Powered by JetHome®