diff options
author | Peter Hurley <peter@hurleysoftware.com> | 2013-06-15 09:36:06 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-23 16:47:08 -0700 |
commit | 809850b7a5fcc0a96d023e1171a7944c60fd5a71 (patch) | |
tree | 5c6a22458a7d756cbfe948bfb6b7d331af01610f /include/linux/tty.h | |
parent | 2cf7b67e87f0d8db025cff12b5d29c0663bbcd87 (diff) | |
download | linux-next-809850b7a5fcc0a96d023e1171a7944c60fd5a71.tar.gz |
tty: Use lockless flip buffer free list
In preparation for lockless flip buffers, make the flip buffer
free list lockless.
NB: using llist is not the optimal solution, as the driver and
buffer work may contend over the llist head unnecessarily. However,
test measurements indicate this contention is low.
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/tty.h')
-rw-r--r-- | include/linux/tty.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/linux/tty.h b/include/linux/tty.h index 87bbaa31ebf5..5043b12f23ea 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -11,6 +11,7 @@ #include <linux/tty_flags.h> #include <uapi/linux/tty.h> #include <linux/rwsem.h> +#include <linux/llist.h> @@ -30,7 +31,10 @@ #define __DISABLED_CHAR '\0' struct tty_buffer { - struct tty_buffer *next; + union { + struct tty_buffer *next; + struct llist_node free; + }; int used; int size; int commit; @@ -65,7 +69,7 @@ struct tty_bufhead { spinlock_t lock; struct tty_buffer *head; /* Queue head */ struct tty_buffer *tail; /* Active buffer */ - struct tty_buffer *free; /* Free queue head */ + struct llist_head free; /* Free queue head */ int memory_used; /* Buffer space used excluding free queue */ }; |