diff options
author | Peter Hurley <peter@hurleysoftware.com> | 2013-12-09 09:23:52 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-12-09 14:09:24 -0500 |
commit | acc0f67f307f52f7aec1cffdc40a786c15dd21d9 (patch) | |
tree | 30fe7356b60d42814b63c3de8ab00ac2bf9ed05d /include/linux/tty.h | |
parent | 9bbc3dca9d2212f900396ab9642c48279657a8c0 (diff) |
tty: Halve flip buffer GFP_ATOMIC memory consumption
tty flip buffers use GFP_ATOMIC allocations for received data
which is to be processed by the line discipline. For each byte
received, an extra byte is used to indicate the error status of
that byte.
Instead, if the received data is error-free, encode the entire
buffer without status bytes.
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/tty.h')
-rw-r--r-- | include/linux/tty.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/tty.h b/include/linux/tty.h index 38fcc0574ba9..ad98b4376968 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -39,10 +39,14 @@ struct tty_buffer { | |||
39 | int size; | 39 | int size; |
40 | int commit; | 40 | int commit; |
41 | int read; | 41 | int read; |
42 | int flags; | ||
42 | /* Data points here */ | 43 | /* Data points here */ |
43 | unsigned long data[0]; | 44 | unsigned long data[0]; |
44 | }; | 45 | }; |
45 | 46 | ||
47 | /* Values for .flags field of tty_buffer */ | ||
48 | #define TTYB_NORMAL 1 /* buffer has no flags buffer */ | ||
49 | |||
46 | static inline unsigned char *char_buf_ptr(struct tty_buffer *b, int ofs) | 50 | static inline unsigned char *char_buf_ptr(struct tty_buffer *b, int ofs) |
47 | { | 51 | { |
48 | return ((unsigned char *)b->data) + ofs; | 52 | return ((unsigned char *)b->data) + ofs; |