From: Peter Hurley <peter@hurleysoftware.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.cz>,
linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
Peter Hurley <peter@hurleysoftware.com>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>
Subject: [PATCH tty-next 0/5] Halve tty buffer memory consumption
Date: Fri, 22 Nov 2013 12:09:53 -0500 [thread overview]
Message-ID: <1385140198-5822-1-git-send-email-peter@hurleysoftware.com> (raw)
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
next reply other threads:[~2013-11-22 17:09 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-22 17:09 Peter Hurley [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1385140198-5822-1-git-send-email-peter@hurleysoftware.com \
--to=peter@hurleysoftware.com \
--cc=dmitry.torokhov@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).