<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/include/linux/tty.h, branch v3.12.43</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.12.43</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.12.43'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2014-05-05T12:24:38Z</updated>
<entry>
<title>tty: Fix low_latency BUG</title>
<updated>2014-05-05T12:24:38Z</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2014-02-22T12:31:21Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=18b258a37ee54cab6d0fc33f70b3c9d0ecf2dfdb'/>
<id>urn:sha1:18b258a37ee54cab6d0fc33f70b3c9d0ecf2dfdb</id>
<content type='text'>
commit a9c3f68f3cd8d55f809fbdb0c138ed061ea1bd25 upstream.

The user-settable knob, low_latency, has been the source of
several BUG reports which stem from flush_to_ldisc() running
in interrupt context. Since 3.12, which added several sleeping
locks (termios_rwsem and buf-&gt;lock) to the input processing path,
the frequency of these BUG reports has increased.

Note that changes in 3.12 did not introduce this regression;
sleeping locks were first added to the input processing path
with the removal of the BKL from N_TTY in commit
a88a69c91256418c5907c2f1f8a0ec0a36f9e6cc,
'n_tty: Fix loss of echoed characters and remove bkl from n_tty'
and later in commit 38db89799bdf11625a831c5af33938dcb11908b6,
'tty: throttling race fix'. Since those changes, executing
flush_to_ldisc() in interrupt_context (ie, low_latency set), is unsafe.

However, since most devices do not validate if the low_latency
setting is appropriate for the context (process or interrupt) in
which they receive data, some reports are due to misconfiguration.
Further, serial dma devices for which dma fails, resort to
interrupt receiving as a backup without resetting low_latency.

Historically, low_latency was used to force wake-up the reading
process rather than wait for the next scheduler tick. The
effect was to trim multiple milliseconds of latency from
when the process would receive new data.

Recent tests [1] have shown that the reading process now receives
data with only 10's of microseconds latency without low_latency set.

Remove the low_latency rx steering from tty_flip_buffer_push();
however, leave the knob as an optional hint to drivers that can
tune their rx fifos and such like. Cleanup stale code comments
regarding low_latency.

[1] https://lkml.org/lkml/2014/2/20/434

"Yay.. thats an annoying historical pain in the butt gone."
	-- Alan Cox

Reported-by: Beat Bolli &lt;bbolli@ewanet.ch&gt;
Reported-by: Pavel Roskin &lt;proski@gnu.org&gt;
Acked-by: David Sterba &lt;dsterba@suse.cz&gt;
Cc: Grant Edwards &lt;grant.b.edwards@gmail.com&gt;
Cc: Stanislaw Gruszka &lt;sgruszka@redhat.com&gt;
Cc: Hal Murray &lt;murray+fedora@ip-64-139-1-69.sjc.megapath.net&gt;
Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Alan Cox &lt;alan@linux.intel.com&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
</entry>
<entry>
<title>tty: Fix lock order in tty_do_resize()</title>
<updated>2013-07-24T22:12:53Z</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2013-07-24T20:43:51Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=dee4a0be69c0e2996188e0c46478eadc280a8954'/>
<id>urn:sha1:dee4a0be69c0e2996188e0c46478eadc280a8954</id>
<content type='text'>
Commits 6a1c0680cf3ba94356ecd58833e1540c93472a57 and
9356b535fcb71db494fc434acceb79f56d15bda2, respectively
  'tty: Convert termios_mutex to termios_rwsem' and
  'n_tty: Access termios values safely'
introduced a circular lock dependency with console_lock and
termios_rwsem.

The lockdep report [1] shows that n_tty_write() will attempt
to claim console_lock while holding the termios_rwsem, whereas
tty_do_resize() may already hold the console_lock while
claiming the termios_rwsem.

Since n_tty_write() and tty_do_resize() do not contend
over the same data -- the tty-&gt;winsize structure -- correct
the lock dependency by introducing a new lock which
specifically serializes access to tty-&gt;winsize only.

[1] Lockdep report

======================================================
[ INFO: possible circular locking dependency detected ]
3.10.0-0+tip-xeon+lockdep #0+tip Not tainted
-------------------------------------------------------
modprobe/277 is trying to acquire lock:
 (&amp;tty-&gt;termios_rwsem){++++..}, at: [&lt;ffffffff81452656&gt;] tty_do_resize+0x36/0xe0

but task is already holding lock:
 ((fb_notifier_list).rwsem){.+.+.+}, at: [&lt;ffffffff8107aac6&gt;] __blocking_notifier_call_chain+0x56/0xc0

which lock already depends on the new lock.

the existing dependency chain (in reverse order) is:

-&gt; #2 ((fb_notifier_list).rwsem){.+.+.+}:
       [&lt;ffffffff810b6d62&gt;] lock_acquire+0x92/0x1f0
       [&lt;ffffffff8175b797&gt;] down_read+0x47/0x5c
       [&lt;ffffffff8107aac6&gt;] __blocking_notifier_call_chain+0x56/0xc0
       [&lt;ffffffff8107ab46&gt;] blocking_notifier_call_chain+0x16/0x20
       [&lt;ffffffff813d7c0b&gt;] fb_notifier_call_chain+0x1b/0x20
       [&lt;ffffffff813d95b2&gt;] register_framebuffer+0x1e2/0x320
       [&lt;ffffffffa01043e1&gt;] drm_fb_helper_initial_config+0x371/0x540 [drm_kms_helper]
       [&lt;ffffffffa01bcb05&gt;] nouveau_fbcon_init+0x105/0x140 [nouveau]
       [&lt;ffffffffa01ad0af&gt;] nouveau_drm_load+0x43f/0x610 [nouveau]
       [&lt;ffffffffa008a79e&gt;] drm_get_pci_dev+0x17e/0x2a0 [drm]
       [&lt;ffffffffa01ad4da&gt;] nouveau_drm_probe+0x25a/0x2a0 [nouveau]
       [&lt;ffffffff813b13db&gt;] local_pci_probe+0x4b/0x80
       [&lt;ffffffff813b1701&gt;] pci_device_probe+0x111/0x120
       [&lt;ffffffff814977eb&gt;] driver_probe_device+0x8b/0x3a0
       [&lt;ffffffff81497bab&gt;] __driver_attach+0xab/0xb0
       [&lt;ffffffff814956ad&gt;] bus_for_each_dev+0x5d/0xa0
       [&lt;ffffffff814971fe&gt;] driver_attach+0x1e/0x20
       [&lt;ffffffff81496cc1&gt;] bus_add_driver+0x111/0x290
       [&lt;ffffffff814982b7&gt;] driver_register+0x77/0x170
       [&lt;ffffffff813b0454&gt;] __pci_register_driver+0x64/0x70
       [&lt;ffffffffa008a9da&gt;] drm_pci_init+0x11a/0x130 [drm]
       [&lt;ffffffffa022a04d&gt;] nouveau_drm_init+0x4d/0x1000 [nouveau]
       [&lt;ffffffff810002ea&gt;] do_one_initcall+0xea/0x1a0
       [&lt;ffffffff810c54cb&gt;] load_module+0x123b/0x1bf0
       [&lt;ffffffff810c5f57&gt;] SyS_init_module+0xd7/0x120
       [&lt;ffffffff817677c2&gt;] system_call_fastpath+0x16/0x1b

-&gt; #1 (console_lock){+.+.+.}:
       [&lt;ffffffff810b6d62&gt;] lock_acquire+0x92/0x1f0
       [&lt;ffffffff810430a7&gt;] console_lock+0x77/0x80
       [&lt;ffffffff8146b2a1&gt;] con_flush_chars+0x31/0x50
       [&lt;ffffffff8145780c&gt;] n_tty_write+0x1ec/0x4d0
       [&lt;ffffffff814541b9&gt;] tty_write+0x159/0x2e0
       [&lt;ffffffff814543f5&gt;] redirected_tty_write+0xb5/0xc0
       [&lt;ffffffff811ab9d5&gt;] vfs_write+0xc5/0x1f0
       [&lt;ffffffff811abec5&gt;] SyS_write+0x55/0xa0
       [&lt;ffffffff817677c2&gt;] system_call_fastpath+0x16/0x1b

-&gt; #0 (&amp;tty-&gt;termios_rwsem){++++..}:
       [&lt;ffffffff810b65c3&gt;] __lock_acquire+0x1c43/0x1d30
       [&lt;ffffffff810b6d62&gt;] lock_acquire+0x92/0x1f0
       [&lt;ffffffff8175b724&gt;] down_write+0x44/0x70
       [&lt;ffffffff81452656&gt;] tty_do_resize+0x36/0xe0
       [&lt;ffffffff8146c841&gt;] vc_do_resize+0x3e1/0x4c0
       [&lt;ffffffff8146c99f&gt;] vc_resize+0x1f/0x30
       [&lt;ffffffff813e4535&gt;] fbcon_init+0x385/0x5a0
       [&lt;ffffffff8146a4bc&gt;] visual_init+0xbc/0x120
       [&lt;ffffffff8146cd13&gt;] do_bind_con_driver+0x163/0x320
       [&lt;ffffffff8146cfa1&gt;] do_take_over_console+0x61/0x70
       [&lt;ffffffff813e2b93&gt;] do_fbcon_takeover+0x63/0xc0
       [&lt;ffffffff813e67a5&gt;] fbcon_event_notify+0x715/0x820
       [&lt;ffffffff81762f9d&gt;] notifier_call_chain+0x5d/0x110
       [&lt;ffffffff8107aadc&gt;] __blocking_notifier_call_chain+0x6c/0xc0
       [&lt;ffffffff8107ab46&gt;] blocking_notifier_call_chain+0x16/0x20
       [&lt;ffffffff813d7c0b&gt;] fb_notifier_call_chain+0x1b/0x20
       [&lt;ffffffff813d95b2&gt;] register_framebuffer+0x1e2/0x320
       [&lt;ffffffffa01043e1&gt;] drm_fb_helper_initial_config+0x371/0x540 [drm_kms_helper]
       [&lt;ffffffffa01bcb05&gt;] nouveau_fbcon_init+0x105/0x140 [nouveau]
       [&lt;ffffffffa01ad0af&gt;] nouveau_drm_load+0x43f/0x610 [nouveau]
       [&lt;ffffffffa008a79e&gt;] drm_get_pci_dev+0x17e/0x2a0 [drm]
       [&lt;ffffffffa01ad4da&gt;] nouveau_drm_probe+0x25a/0x2a0 [nouveau]
       [&lt;ffffffff813b13db&gt;] local_pci_probe+0x4b/0x80
       [&lt;ffffffff813b1701&gt;] pci_device_probe+0x111/0x120
       [&lt;ffffffff814977eb&gt;] driver_probe_device+0x8b/0x3a0
       [&lt;ffffffff81497bab&gt;] __driver_attach+0xab/0xb0
       [&lt;ffffffff814956ad&gt;] bus_for_each_dev+0x5d/0xa0
       [&lt;ffffffff814971fe&gt;] driver_attach+0x1e/0x20
       [&lt;ffffffff81496cc1&gt;] bus_add_driver+0x111/0x290
       [&lt;ffffffff814982b7&gt;] driver_register+0x77/0x170
       [&lt;ffffffff813b0454&gt;] __pci_register_driver+0x64/0x70
       [&lt;ffffffffa008a9da&gt;] drm_pci_init+0x11a/0x130 [drm]
       [&lt;ffffffffa022a04d&gt;] nouveau_drm_init+0x4d/0x1000 [nouveau]
       [&lt;ffffffff810002ea&gt;] do_one_initcall+0xea/0x1a0
       [&lt;ffffffff810c54cb&gt;] load_module+0x123b/0x1bf0
       [&lt;ffffffff810c5f57&gt;] SyS_init_module+0xd7/0x120
       [&lt;ffffffff817677c2&gt;] system_call_fastpath+0x16/0x1b

other info that might help us debug this:

Chain exists of:
  &amp;tty-&gt;termios_rwsem --&gt; console_lock --&gt; (fb_notifier_list).rwsem

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock((fb_notifier_list).rwsem);
                               lock(console_lock);
                               lock((fb_notifier_list).rwsem);
  lock(&amp;tty-&gt;termios_rwsem);

 *** DEADLOCK ***

7 locks held by modprobe/277:
 #0:  (&amp;__lockdep_no_validate__){......}, at: [&lt;ffffffff81497b5b&gt;] __driver_attach+0x5b/0xb0
 #1:  (&amp;__lockdep_no_validate__){......}, at: [&lt;ffffffff81497b69&gt;] __driver_attach+0x69/0xb0
 #2:  (drm_global_mutex){+.+.+.}, at: [&lt;ffffffffa008a6dd&gt;] drm_get_pci_dev+0xbd/0x2a0 [drm]
 #3:  (registration_lock){+.+.+.}, at: [&lt;ffffffff813d93f5&gt;] register_framebuffer+0x25/0x320
 #4:  (&amp;fb_info-&gt;lock){+.+.+.}, at: [&lt;ffffffff813d8116&gt;] lock_fb_info+0x26/0x60
 #5:  (console_lock){+.+.+.}, at: [&lt;ffffffff813d95a4&gt;] register_framebuffer+0x1d4/0x320
 #6:  ((fb_notifier_list).rwsem){.+.+.+}, at: [&lt;ffffffff8107aac6&gt;] __blocking_notifier_call_chain+0x56/0xc0

stack backtrace:
CPU: 0 PID: 277 Comm: modprobe Not tainted 3.10.0-0+tip-xeon+lockdep #0+tip
Hardware name: Dell Inc. Precision WorkStation T5400  /0RW203, BIOS A11 04/30/2012
 ffffffff8213e5e0 ffff8802aa2fb298 ffffffff81755f19 ffff8802aa2fb2e8
 ffffffff8174f506 ffff8802aa2fa000 ffff8802aa2fb378 ffff8802aa2ea8e8
 ffff8802aa2ea910 ffff8802aa2ea8e8 0000000000000006 0000000000000007
Call Trace:
 [&lt;ffffffff81755f19&gt;] dump_stack+0x19/0x1b
 [&lt;ffffffff8174f506&gt;] print_circular_bug+0x1fb/0x20c
 [&lt;ffffffff810b65c3&gt;] __lock_acquire+0x1c43/0x1d30
 [&lt;ffffffff810b775e&gt;] ? mark_held_locks+0xae/0x120
 [&lt;ffffffff810b78d5&gt;] ? trace_hardirqs_on_caller+0x105/0x1d0
 [&lt;ffffffff810b6d62&gt;] lock_acquire+0x92/0x1f0
 [&lt;ffffffff81452656&gt;] ? tty_do_resize+0x36/0xe0
 [&lt;ffffffff8175b724&gt;] down_write+0x44/0x70
 [&lt;ffffffff81452656&gt;] ? tty_do_resize+0x36/0xe0
 [&lt;ffffffff81452656&gt;] tty_do_resize+0x36/0xe0
 [&lt;ffffffff8146c841&gt;] vc_do_resize+0x3e1/0x4c0
 [&lt;ffffffff8146c99f&gt;] vc_resize+0x1f/0x30
 [&lt;ffffffff813e4535&gt;] fbcon_init+0x385/0x5a0
 [&lt;ffffffff8146a4bc&gt;] visual_init+0xbc/0x120
 [&lt;ffffffff8146cd13&gt;] do_bind_con_driver+0x163/0x320
 [&lt;ffffffff8146cfa1&gt;] do_take_over_console+0x61/0x70
 [&lt;ffffffff813e2b93&gt;] do_fbcon_takeover+0x63/0xc0
 [&lt;ffffffff813e67a5&gt;] fbcon_event_notify+0x715/0x820
 [&lt;ffffffff81762f9d&gt;] notifier_call_chain+0x5d/0x110
 [&lt;ffffffff8107aadc&gt;] __blocking_notifier_call_chain+0x6c/0xc0
 [&lt;ffffffff8107ab46&gt;] blocking_notifier_call_chain+0x16/0x20
 [&lt;ffffffff813d7c0b&gt;] fb_notifier_call_chain+0x1b/0x20
 [&lt;ffffffff813d95b2&gt;] register_framebuffer+0x1e2/0x320
 [&lt;ffffffffa01043e1&gt;] drm_fb_helper_initial_config+0x371/0x540 [drm_kms_helper]
 [&lt;ffffffff8173cbcb&gt;] ? kmemleak_alloc+0x5b/0xc0
 [&lt;ffffffff81198874&gt;] ? kmem_cache_alloc_trace+0x104/0x290
 [&lt;ffffffffa01035e1&gt;] ? drm_fb_helper_single_add_all_connectors+0x81/0xf0 [drm_kms_helper]
 [&lt;ffffffffa01bcb05&gt;] nouveau_fbcon_init+0x105/0x140 [nouveau]
 [&lt;ffffffffa01ad0af&gt;] nouveau_drm_load+0x43f/0x610 [nouveau]
 [&lt;ffffffffa008a79e&gt;] drm_get_pci_dev+0x17e/0x2a0 [drm]
 [&lt;ffffffffa01ad4da&gt;] nouveau_drm_probe+0x25a/0x2a0 [nouveau]
 [&lt;ffffffff8175f162&gt;] ? _raw_spin_unlock_irqrestore+0x42/0x80
 [&lt;ffffffff813b13db&gt;] local_pci_probe+0x4b/0x80
 [&lt;ffffffff813b1701&gt;] pci_device_probe+0x111/0x120
 [&lt;ffffffff814977eb&gt;] driver_probe_device+0x8b/0x3a0
 [&lt;ffffffff81497bab&gt;] __driver_attach+0xab/0xb0
 [&lt;ffffffff81497b00&gt;] ? driver_probe_device+0x3a0/0x3a0
 [&lt;ffffffff814956ad&gt;] bus_for_each_dev+0x5d/0xa0
 [&lt;ffffffff814971fe&gt;] driver_attach+0x1e/0x20
 [&lt;ffffffff81496cc1&gt;] bus_add_driver+0x111/0x290
 [&lt;ffffffffa022a000&gt;] ? 0xffffffffa0229fff
 [&lt;ffffffff814982b7&gt;] driver_register+0x77/0x170
 [&lt;ffffffffa022a000&gt;] ? 0xffffffffa0229fff
 [&lt;ffffffff813b0454&gt;] __pci_register_driver+0x64/0x70
 [&lt;ffffffffa008a9da&gt;] drm_pci_init+0x11a/0x130 [drm]
 [&lt;ffffffffa022a000&gt;] ? 0xffffffffa0229fff
 [&lt;ffffffffa022a000&gt;] ? 0xffffffffa0229fff
 [&lt;ffffffffa022a04d&gt;] nouveau_drm_init+0x4d/0x1000 [nouveau]
 [&lt;ffffffff810002ea&gt;] do_one_initcall+0xea/0x1a0
 [&lt;ffffffff810c54cb&gt;] load_module+0x123b/0x1bf0
 [&lt;ffffffff81399a50&gt;] ? ddebug_proc_open+0xb0/0xb0
 [&lt;ffffffff813855ae&gt;] ? trace_hardirqs_on_thunk+0x3a/0x3f
 [&lt;ffffffff810c5f57&gt;] SyS_init_module+0xd7/0x120
 [&lt;ffffffff817677c2&gt;] system_call_fastpath+0x16/0x1b

Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>n_tty: Fix EOF push handling</title>
<updated>2013-07-24T00:08:40Z</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2013-06-15T14:21:17Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=40d5e0905a03601d40cd4e46b8690093c2355d03'/>
<id>urn:sha1:40d5e0905a03601d40cd4e46b8690093c2355d03</id>
<content type='text'>
In canonical mode, an EOF which is not the first character of the line
causes read() to complete and return the number of characters read so
far (commonly referred to as EOF push). However, if the previous read()
returned because the user buffer was full _and_ the next character
is an EOF not at the beginning of the line, read() must not return 0,
thus mistakenly indicating the end-of-file condition.

The TTY_PUSH flag is used to indicate an EOF was received which is not
at the beginning of the line. Because the EOF push condition is
evaluated by a thread other than the read(), multiple EOF pushes can
cause a premature end-of-file to be indicated.

Instead, discover the 'EOF push as first read character' condition
from the read() thread itself, and restart the i/o loop if detected.

Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: Remove private constant from global namespace</title>
<updated>2013-07-23T23:47:10Z</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2013-06-15T13:36:16Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9114fe8ccf1871f630d2c14cd60e5f455b015459'/>
<id>urn:sha1:9114fe8ccf1871f630d2c14cd60e5f455b015459</id>
<content type='text'>
TTY_BUFFER_PAGE is only used within drivers/tty/tty_buffer.c;
relocate to that file scope.

Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: Fix unsafe vt paste_selection()</title>
<updated>2013-07-23T23:47:10Z</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2013-06-15T13:36:15Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a7c8d58c79853adeebf0a1ddc9c63e433b4d97f1'/>
<id>urn:sha1:a7c8d58c79853adeebf0a1ddc9c63e433b4d97f1</id>
<content type='text'>
Convert the tty_buffer_flush() exclusion mechanism to a
public interface - tty_buffer_lock/unlock_exclusive() - and use
the interface to safely write the paste selection to the line
discipline.

Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: Use non-atomic state to signal flip buffer flush pending</title>
<updated>2013-07-23T23:47:09Z</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2013-06-15T13:36:13Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=0f56bd2f6a97d8b0eb5c8f9bc04b83a6c16d1d48'/>
<id>urn:sha1:0f56bd2f6a97d8b0eb5c8f9bc04b83a6c16d1d48</id>
<content type='text'>
Atomic bit ops are no longer required to indicate a flip buffer
flush is pending, as the flush_mutex is sufficient barrier.

Remove the unnecessary port .iflags field and localize flip buffer
state to struct tty_bufhead.

Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: Avoid false-sharing flip buffer ptrs</title>
<updated>2013-07-23T23:47:09Z</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2013-06-15T13:36:12Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=8c1fb49ba107c7db9441ef6ec0ab5830d112cc2a'/>
<id>urn:sha1:8c1fb49ba107c7db9441ef6ec0ab5830d112cc2a</id>
<content type='text'>
Separate the head and tail ptrs to avoid cache-line contention
(so called 'false-sharing') between concurrent threads.

Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: Only perform flip buffer flush from tty_buffer_flush()</title>
<updated>2013-07-23T23:47:09Z</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2013-06-15T13:36:11Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d7a68be4f265be10e24be931c257af30ca55566b'/>
<id>urn:sha1:d7a68be4f265be10e24be931c257af30ca55566b</id>
<content type='text'>
Now that dropping the buffer lock is not necessary (as result of
converting the spin lock to a mutex), the flip buffer flush no
longer needs to be handled by the buffer work.

Simply signal a flush is required; the buffer work will exit the
i/o loop, which allows tty_buffer_flush() to proceed.

Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: Ensure single-threaded flip buffer consumer with mutex</title>
<updated>2013-07-23T23:47:09Z</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2013-06-15T13:36:10Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e9975fdec0138f1b2a85b9624e41660abd9865d4'/>
<id>urn:sha1:e9975fdec0138f1b2a85b9624e41660abd9865d4</id>
<content type='text'>
The buffer work may race with parallel tty_buffer_flush. Use a
mutex to guarantee exclusive modify access to the head flip
buffer.

Remove the unneeded spin lock.

Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: Track flip buffer memory limit atomically</title>
<updated>2013-07-23T23:47:08Z</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2013-06-15T13:36:08Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7bfe0b7116be207cf2204ae06335cc89d8f8ee02'/>
<id>urn:sha1:7bfe0b7116be207cf2204ae06335cc89d8f8ee02</id>
<content type='text'>
Lockless flip buffers require atomically updating the bytes-in-use
watermark.

The pty driver also peeks at the watermark value to limit
memory consumption to a much lower value than the default; query
the watermark with new fn, tty_buffer_space_avail().

Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
