提交 30a589fd 编写于 作者: A Adam Jackson 提交者: Dmitry Torokhov

Input: evdev - be less aggressive about sending SIGIO notifies

When using realtime signals, we'll enqueue one signal for every event.
This is unfortunate, because (for example) keyboard presses are three
events: key, msc scancode, and syn.  They'll be enqueued fast enough in
kernel space that all three events will be ready to read by the time
userspace runs, so the first invocation of the signal handler will read
all three events, but then the second two invocations still have to run
to do no work.

Instead, only send the SIGIO notification on syn events.  This is a
slight abuse of SIGIO semantics, in principle it ought to fire as soon
as any events are readable.  But it matches evdev semantics, which is
more important since SIGIO is rather vaguely defined to begin with.
Signed-off-by: NAdam Jackson <ajax@redhat.com>
Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
上级 0ef7a26a
...@@ -59,7 +59,8 @@ static void evdev_pass_event(struct evdev_client *client, ...@@ -59,7 +59,8 @@ static void evdev_pass_event(struct evdev_client *client,
client->head &= EVDEV_BUFFER_SIZE - 1; client->head &= EVDEV_BUFFER_SIZE - 1;
spin_unlock(&client->buffer_lock); spin_unlock(&client->buffer_lock);
kill_fasync(&client->fasync, SIGIO, POLL_IN); if (event->type == EV_SYN)
kill_fasync(&client->fasync, SIGIO, POLL_IN);
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册