Skip to content

Commit

Permalink
tty: Avoid false-sharing flip buffer ptrs
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Peter Hurley authored and Greg Kroah-Hartman committed Jul 23, 2013
1 parent d7a68be commit 8c1fb49
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/linux/tty.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8c1fb49

Please sign in to comment.