mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
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>
This commit is contained in:
parent
9bbc3dca9d
commit
acc0f67f30
3 changed files with 45 additions and 12 deletions
|
@ -39,10 +39,14 @@ struct tty_buffer {
|
|||
int size;
|
||||
int commit;
|
||||
int read;
|
||||
int flags;
|
||||
/* Data points here */
|
||||
unsigned long data[0];
|
||||
};
|
||||
|
||||
/* Values for .flags field of tty_buffer */
|
||||
#define TTYB_NORMAL 1 /* buffer has no flags buffer */
|
||||
|
||||
static inline unsigned char *char_buf_ptr(struct tty_buffer *b, int ofs)
|
||||
{
|
||||
return ((unsigned char *)b->data) + ofs;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue