Re: TTY Flip buffers

Sameer (sameer@multitech.co.in)
Wed, 24 Nov 1999 14:24:35 +0530


A large buffer could solve the problem, but would'nt it be better if the driver
could get a fore-warning when the flip buffer was on the verge of getting full?
It could then stop the RX interrupts until the "flush_to_ldisc" would empty and
flip the flip buffer and inform the driver about the same. I have had instances
on a loaded system with all the ports on a mulltiport card doing RX s, the
"flush_to_ldisc" will not be scheduled enough to make sufficient free space on
the flip buffer for the next RX interrupt.

regards,
sameer.

John Alvord wrote:

> As I recall, there is a patch in Ted's pipeline that permits a larger
> Flip buffer. Don't forget that there are two 512 byte buffers involved
> right now.... so the current environment works in a lot of
> environments. john
>
> On Wed, 24 Nov 1999 09:54:17 +0530, Sameer <sameer@multitech.co.in>
> wrote:
>
> >In the drivers (kernel-2.2.x) for most of the multiport cards, it seems
> >like bytes could get dropped when the current flip buffer gets full in
> >the interrupt handlers especially at high baud rates. Is there already
> >some code lurking in there which does throttling to avoid this? I feel
> >otherwise since these drivers would have no prior information regarding
> >the vacany in the flip buffer other than in the interrupt handler
> >itself, to stop RX interrupts from occuring . Could something like a
> >high water mark be implemented for the flip buffers? This would then
> >definitely require a bigger flip buffer ( greater than 512 bytes),
> >Would'nt it?
> >
> >regards,
> >sameer.
> >
> >> Note that the char_buf buffer size is 2*TTY_FLIPBUF_SIZE. However,
> >all
> >> serial drivers check the value TTY_FLIPBUF_SIZE in order to know
> >whether
> >> the buffer is full or not.
> >>
> >> Is this correct?? Shouldn't the serial drivers be checking for
> >> 2*TTY_FLIPBUF_SIZE?? Aren't the serial drivers subutilizing the flip
> >
> >> buffers in this way??
> >
> >>The existing code is correct. The reason why the buffer is
> >>2*TTY_FLIPBUF_SIZE is that we're doing double buffering; first one half
> >
> >>of the buffer is filled, while the other half is being processed by the
> >
> >>line discpline, and then the two (half) buffers are flipped --- this
> >the
> >>name "flip buffers". It really is double buffering by another name; I
> >>wasn't familiar with the more commonly used name when I reinvented the
> >>technique for Linux. :-)
> >
> > Another question: if I want to use a larger flip buffer, can I just
> > allocate the required memory amount and set the pointers char_buf_ptr
> >and
> > flag_buf_ptr?? If not, I don't see the reason for the existence of
> >these
> > pointers ...
> >
> >You have to change the routines that set and reset those pointers when
> >the flip buffers are flipped. There is a patch outstanding to allow
> >bigger flip buffers, and I'll hopefully have a chance to look at it over
> >
> >Thanksgiving weekend. (My apologies Pavel for my delay in looking over
> >your patch; I've been swamped lately.)
> >
> > - Ted
> >
> >
> >
> >
> >-
> >To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> >the body of a message to majordomo@vger.rutgers.edu
> >Please read the FAQ at http://www.tux.org/lkml/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/