tty: Track flip buffer memory limit atomically
Lockless flip buffers require atomically updating the bytes-in-use watermark. The pty driver also peeks at the watermark value to limit memory consumption to a much lower value than the default; query the watermark with new fn, tty_buffer_space_avail(). Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
7391ee1695
commit
7bfe0b7116
+1
-2
@@ -71,8 +71,7 @@ struct tty_bufhead {
|
||||
struct tty_buffer *head; /* Queue head */
|
||||
struct tty_buffer *tail; /* Active buffer */
|
||||
struct llist_head free; /* Free queue head */
|
||||
int memory_used; /* Buffer space used excluding
|
||||
free queue */
|
||||
atomic_t memory_used; /* In-use buffers excluding free list */
|
||||
};
|
||||
/*
|
||||
* When a break, frame error, or parity error happens, these codes are
|
||||
|
||||
Reference in New Issue
Block a user