linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH tty-next 0/5] Halve tty buffer memory consumption
@ 2013-11-22 17:09 Peter Hurley
  2013-11-22 17:09 ` [PATCH tty-next 1/5] tty: Always handle NULL flag ptr Peter Hurley
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Peter Hurley @ 2013-11-22 17:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, linux-kernel, linux-serial, Peter Hurley,
	Dmitry Torokhov

Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>

Greg,

This patchset implements a method of encoding tty 'flip' buffers
such that storage is not allocated for per-byte-received 'flag' bytes
if the data received contains no error.

The N_TTY line discipline already contains logic which assumes that
if the flags buffer ptr is NULL, all data is assumed to be TTY_NORMAL.

Patch 1 documents this behavior and fixes line disciplines not already
handling this condition. The INPUT maintainer is Cc'd on the N_MOUSE
changes.
Patch 2 enables the port driver to alter the default 64k limit
imposed by the tty_buffer core. Hi-throughput drivers (>10MB/sec) can
use this to reduce/eliminate dropped data. A forthcoming fwserial patchset
does just this to remove local rx buffering (and 100 lines of code).
Patch 3 s/memory_used/mem_used
Patch 4 removes the unused tty_prepare_flip_string_flags() function
Patch 5 implements the NULL flag buffer encoding scheme.

For each allocated flip buffer, a bitfield is added which is
used to differentiate a flip buffer without a flags buffer (in which
all data is TTY_NORMAL) from a flip buffer containing 'flagged' data.

If the current flip buffer has no flags field and new 'flagged' data
is inserted, the current flip buffer is committed and a new current
flip buffer is allocated with a flags buffer.

Users of tty_insert_flip_string_flag() always allocates a flags
buffer on the assumption that data is not entirely TTY_NORMAL.

Regards,

Peter Hurley (5):
  tty: Always handle NULL flag ptr
  tty: Enable configurable tty flip buffer limit
  tty: Rename tty buffer memory_used field
  tty: Remove tty_prepare_flip_string_flags()
  tty: Halve flip buffer GFP_ATOMIC memory consumption

 drivers/input/serio/serport.c |  28 +++++------
 drivers/tty/n_gsm.c           |   5 +-
 drivers/tty/n_r3964.c         |   2 +-
 drivers/tty/tty_buffer.c      | 105 ++++++++++++++++++++++++------------------
 include/linux/tty.h           |   7 ++-
 include/linux/tty_flip.h      |  11 +++--
 include/linux/tty_ldisc.h     |   6 ++-
 7 files changed, 96 insertions(+), 68 deletions(-)

-- 
1.8.1.2

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2013-12-09 14:24 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-22 17:09 [PATCH tty-next 0/5] Halve tty buffer memory consumption Peter Hurley
2013-11-22 17:09 ` [PATCH tty-next 1/5] tty: Always handle NULL flag ptr Peter Hurley
2013-11-22 22:20   ` Dmitry Torokhov
2013-11-26  2:00     ` Peter Hurley
2013-12-02 18:56     ` [PATCH v2 " Peter Hurley
2013-12-02 19:09       ` Dmitry Torokhov
2013-11-22 17:09 ` [PATCH tty-next 2/5] tty: Enable configurable tty flip buffer limit Peter Hurley
2013-11-22 17:09 ` [PATCH tty-next 3/5] tty: Rename tty buffer memory_used field Peter Hurley
2013-11-22 17:09 ` [PATCH tty-next 4/5] tty: Remove tty_prepare_flip_string_flags() Peter Hurley
2013-11-22 17:09 ` [PATCH tty-next 5/5] tty: Halve flip buffer GFP_ATOMIC memory consumption Peter Hurley
2013-12-09  1:01   ` Greg Kroah-Hartman
2013-12-09 13:27     ` Peter Hurley
2013-12-09 14:23     ` [PATCH tty-next v3 " Peter Hurley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).