mirror of
https://github.com/torvalds/linux
synced 2024-10-28 06:09:03 +00:00
tty: Avoid false-sharing flip buffer ptrs
Separate the head and tail ptrs to avoid cache-line contention (so called 'false-sharing') between concurrent threads. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
d7a68be4f2
commit
8c1fb49ba1
|
@ -65,13 +65,13 @@ static inline char *flag_buf_ptr(struct tty_buffer *b, int ofs)
|
||||||
|
|
||||||
|
|
||||||
struct tty_bufhead {
|
struct tty_bufhead {
|
||||||
|
struct tty_buffer *head; /* Queue head */
|
||||||
struct work_struct work;
|
struct work_struct work;
|
||||||
struct mutex flush_mutex;
|
struct mutex flush_mutex;
|
||||||
struct tty_buffer sentinel;
|
struct tty_buffer sentinel;
|
||||||
struct tty_buffer *head; /* Queue head */
|
|
||||||
struct tty_buffer *tail; /* Active buffer */
|
|
||||||
struct llist_head free; /* Free queue head */
|
struct llist_head free; /* Free queue head */
|
||||||
atomic_t memory_used; /* In-use buffers excluding free list */
|
atomic_t memory_used; /* In-use buffers excluding free list */
|
||||||
|
struct tty_buffer *tail; /* Active buffer */
|
||||||
};
|
};
|
||||||
/*
|
/*
|
||||||
* When a break, frame error, or parity error happens, these codes are
|
* When a break, frame error, or parity error happens, these codes are
|
||||||
|
|
Loading…
Reference in a new issue