lkml.org 
[lkml]   [2004]   [Oct]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH] TTY flip buffer SMP changes
On Thu, Oct 07, 2004 at 08:37:12PM +0100, Alan Cox wrote:
>
> Now that networking is not a kernel option it seems slightly dumb that
> the tty layer doesn't just use the sk_buff model (probably not code).
> kmalloc is very fast and it kills TTY_DONT_FLIP because every buffer is
> owned by _one_ person at a time. (sk_buff's dont direclty fit too well
> because we push both error and bits per byte and don't last time I
> checked support recycling).

Suggestion: use two skbuff's for the data bytes and the error flags,
and make the error skbufs be optional --- sometimes the line discpline
won't care about the error bytes at all (example: raw mode).

Even if kmalloc() isn't as fast using two ring buffers which we flip
back and forth, CPU's have gotten a lot faster since when I
implemented the flip buffers some 12 years ago (i.e., 8 Moore law's
doublings ago). If you nuke flip buffers, I'm not going to take it
personally. :-)

> Another nice effect is simplifying the ldisc and driver level locking.
> Drivers queue buffers, ldiscs eat buffers. If the driver queues a buffer
> and there is temporarily no ldisc it does not get lost.

Agreed.

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

\
 
 \ /
  Last update: 2005-03-22 14:06    [from the cache]
©2003-2011 Jasper Spaans