lkml.org 
[lkml]   [2013]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 12/16] tty: Avoid false-sharing flip buffer ptrs
Date
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>
---
include/linux/tty.h | 4 ++--
1 file 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
--
1.8.1.2


\
 
 \ /
  Last update: 2013-06-15 16:21    [W:1.587 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site