linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] input: evdev: Dynamic buffers (rev2)
@ 2010-05-29 15:57 Henrik Rydberg
  2010-05-29 15:57 ` [PATCH 1/3] input: evdev: use multi-reader buffer to save space (rev2) Henrik Rydberg
  0 siblings, 1 reply; 5+ messages in thread
From: Henrik Rydberg @ 2010-05-29 15:57 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-input, Jiri Kosina, Mika Kuoppala, Benjamin Tissoires,
	Rafi Rubin, Henrik Rydberg

Ok, second version of the evdev buffer patches.

In the first patch, the locking has been completely reworked. The
buffer locking is now similar to seqlock, except the readers only
block while there is an update affecting the current read. Should be
fairly optimal, but we can always revert to seqlocks in case the
scatter of smp instructions feels inadequate.

The second patch only has trivial changes, and the third patch is
unchanged, but included for completeness.

Cheers,
Henrik

---

Henrik Rydberg (3):
  input: evdev: use multi-reader buffer to save space (rev2)
  input: evdev: convert to dynamic event buffer (rev2)
  input: use driver hint to compute the evdev buffer size

 drivers/input/evdev.c |   90 +++++++++++++++++++++++++++++++++---------------
 include/linux/input.h |    7 ++++
 2 files changed, 69 insertions(+), 28 deletions(-)


^ permalink raw reply	[flat|nested] 5+ messages in thread
* [PATCH 0/3] input: evdev: Dynamic buffers
@ 2010-05-28 15:10 Henrik Rydberg
  2010-05-28 15:10 ` [PATCH 1/3] input: evdev: use multi-reader buffer to save space Henrik Rydberg
  0 siblings, 1 reply; 5+ messages in thread
From: Henrik Rydberg @ 2010-05-28 15:10 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-input, Jiri Kosina, Mika Kuoppala, Benjamin Tissoires,
	Rafi Rubin, Henrik Rydberg

Hi Dmitry,

Here is a first stab at the problem of overrun buffers in evdev, when
running MT devices.

The approach is to first convert the current evdev client fifos to a
single multi-reader buffer, to save memory and increase resilience
towards many listeners. Locking is sparsely utilized in favor of
atomic operations, and there might be a memory barrier missing.  In
the second patch, the (single) static buffer is converted to a dynamic
one, leaving the current buffer size intact. The third patch
introduces the events_per_packet interface in input_dev, and utilizes
the information to compute the evdev buffer size.

The patches are lightly tested, anticipating some discussion.

Cheers,
Henrik

---

Henrik Rydberg (3):
  input: evdev: use multi-reader buffer to save space
  input: evdev: convert to dynamic event buffer
  input: use driver hint to compute the evdev buffer size

 drivers/input/evdev.c |   82 ++++++++++++++++++++++++++++++------------------
 include/linux/input.h |    7 ++++
 2 files changed, 58 insertions(+), 31 deletions(-)


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-05-29 16:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-29 15:57 [PATCH 0/3] input: evdev: Dynamic buffers (rev2) Henrik Rydberg
2010-05-29 15:57 ` [PATCH 1/3] input: evdev: use multi-reader buffer to save space (rev2) Henrik Rydberg
2010-05-29 15:57   ` [PATCH 2/3] input: evdev: convert to dynamic event buffer (rev2) Henrik Rydberg
2010-05-29 15:57     ` [PATCH 3/3] input: use driver hint to compute the evdev buffer size Henrik Rydberg
  -- strict thread matches above, loose matches on Subject: below --
2010-05-28 15:10 [PATCH 0/3] input: evdev: Dynamic buffers Henrik Rydberg
2010-05-28 15:10 ` [PATCH 1/3] input: evdev: use multi-reader buffer to save space Henrik Rydberg
2010-05-28 15:10   ` [PATCH 2/3] input: evdev: convert to dynamic event buffer Henrik Rydberg
2010-05-28 15:10     ` [PATCH 3/3] input: use driver hint to compute the evdev buffer size Henrik Rydberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).