diff options
author | Peter Hurley <peter@hurleysoftware.com> | 2013-06-15 09:36:12 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-23 16:47:09 -0700 |
commit | 8c1fb49ba107c7db9441ef6ec0ab5830d112cc2a (patch) | |
tree | c4733126d13fdf57e10638c18da280c0e7e103ac | |
parent | d7a68be4f265be10e24be931c257af30ca55566b (diff) | |
download | kernel_goldelico_gta04-8c1fb49ba107c7db9441ef6ec0ab5830d112cc2a.zip kernel_goldelico_gta04-8c1fb49ba107c7db9441ef6ec0ab5830d112cc2a.tar.gz kernel_goldelico_gta04-8c1fb49ba107c7db9441ef6ec0ab5830d112cc2a.tar.bz2 |
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>
-rw-r--r-- | include/linux/tty.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/tty.h b/include/linux/tty.h index 1d5bacc..b8e8adf 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -65,13 +65,13 @@ static inline char *flag_buf_ptr(struct tty_buffer *b, int ofs) struct tty_bufhead { + struct tty_buffer *head; /* Queue head */ struct work_struct work; struct mutex flush_mutex; struct tty_buffer sentinel; - struct tty_buffer *head; /* Queue head */ - struct tty_buffer *tail; /* Active buffer */ struct llist_head free; /* Free queue head */ 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 |