Commit 87189b78 authored by Kenny Levinsen's avatar Kenny Levinsen Committed by Daniel Vetter

drm: make drm_file use keyed wakeups

Some processes, such as systemd, are only polling for EPOLLERR|EPOLLHUP.
As drm_file uses unkeyed wakeups, such a poll receives many spurious
wakeups from uninteresting events.

Use keyed wakeups to allow the wakeup target to more efficiently discard
these uninteresting events.
Signed-off-by: default avatarKenny Levinsen <kl@kl.wtf>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200424145103.3048-1-kl@kl.wtf
parent d8394949
...@@ -613,7 +613,8 @@ ssize_t drm_read(struct file *filp, char __user *buffer, ...@@ -613,7 +613,8 @@ ssize_t drm_read(struct file *filp, char __user *buffer,
file_priv->event_space -= length; file_priv->event_space -= length;
list_add(&e->link, &file_priv->event_list); list_add(&e->link, &file_priv->event_list);
spin_unlock_irq(&dev->event_lock); spin_unlock_irq(&dev->event_lock);
wake_up_interruptible(&file_priv->event_wait); wake_up_interruptible_poll(&file_priv->event_wait,
EPOLLIN | EPOLLRDNORM);
break; break;
} }
...@@ -809,7 +810,8 @@ void drm_send_event_locked(struct drm_device *dev, struct drm_pending_event *e) ...@@ -809,7 +810,8 @@ void drm_send_event_locked(struct drm_device *dev, struct drm_pending_event *e)
list_del(&e->pending_link); list_del(&e->pending_link);
list_add_tail(&e->link, list_add_tail(&e->link,
&e->file_priv->event_list); &e->file_priv->event_list);
wake_up_interruptible(&e->file_priv->event_wait); wake_up_interruptible_poll(&e->file_priv->event_wait,
EPOLLIN | EPOLLRDNORM);
} }
EXPORT_SYMBOL(drm_send_event_locked); EXPORT_SYMBOL(drm_send_event_locked);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment