Re: performance-improvement-of-serial-console-via-virtual.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 13, 2005 at 08:44:37PM +0900, Hironobu Ishii wrote:
> Hi Russel,
> 
> I am working with Taku,
> 
> > On Thu, Sep 08, 2005 at 04:47:32PM +0900, Taku Izumi wrote:
> >> >I don't think we want this.  With early serial console, tx_loadsz is
> >> >not guaranteed to be initialised, and may in fact be zero.
> >> 
> >> >Plus there's no guarantee that the FIFOs will actually be enabled, so
> >> >I think it's better that this patch doesn't go to mainline.
> >> 
> >> Our server has a virtual serial port, but its performance seems to be poor.
> >> It takes 10 seconds to output 4000 characters (from kernel) to serial
> >> console. By applying my patch, its peformance could be improved. ( 0.4
> >> seconds / 4000 characters output), so I think it is useful to use FIFO at
> >> serial8250_console_write function like transmit_chars function. Where
> >> should I correct in order to use FIFO?
> > 
> > The problem is that we don't know:
> > 
> > * if there is a FIFO
> > * what size the FIFO is
> 
> I understand tx_loadsz is practical TX FIFO size. 
> If there is no FIFO, tx_loadsz becomes 1.
> Is it wrong?
>   
>  - tx_loadsz is properly initilized in autoconfig().
>  - FIFO is enabled in serial8250_clear_fifo() called from autoconfig(),
>    if FIFO exist.
>  - autoconfig() is called from serial8250_isa_init_ports().
>  - serial8250_isa_init_ports() is called from serial8250_console_init() etc.
>  
> I can't find the problem you are pointing out.

autoconfig() is _not_ called from serial8250_isa_init_ports().

The problem is that the console write method may be called prior to
autoconfig() being run for the port in question, so tx_loadsz may be
uninitialised.

> > * if it has been initialised
> > * how much data is already contained in the FIFO
> 
> Right, we can't know how many byte exist in the FIFO.
> So this patch is waiting the FIFO becomes empty at first
> by calling "wait_for_xmitr(up)".
> (This is the same logic with original.)
> 
> After TX FIFO become empty, we can decide the available 
> TX FIFO depth by up->tx_loadsize.

Only if you ignore the fact that tx_loadsz may not be initialised.

The only things which the console code can rely on being initialised
is the port address description (iobase / membase / iotype / regshift),
the flow control (UPF_CONS_FLOW) in flags, and in the case of Xscale
systems, the capabilities.  Everything else will be in an indeterminent
state as far as the serial console code is concerned, and therefore can
not be relied upon.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux