drm: make drm_file use keyed wakeups
Subsystems (2)
PATCH 1/1 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.
--- drivers/gpu/drm/drm_file.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_file.c +4 -2
@@ -608,7 +608,8 @@ ssize_t drm_read(struct file *filp, char __user *buffer, file_priv->event_space -= length;list_add (&e->link, &file_priv->event_list);spin_unlock_irq (&dev->event_lock); -wake_up_interruptible (&file_priv->event_wait); +wake_up_interruptible_poll (&file_priv->event_wait, +EPOLLIN |EPOLLRDNORM );break ; }
@@ -804,7 +805,8 @@ void drm_send_event_locked(struct drm_device *dev, struct drm_pending_event *e)list_del (&e->pending_link);list_add_tail (&e->link, &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);
Signature · 1 line
2.26.1
Quoted 8 lines · Kenny Levinsen
Some processes, such as systemd, are only polling for EPOLLERR|EPOLLHUP. As
drm_fileuses 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 Kenny Levinsen <[email protected]>
intel-gfx CI is happy, I'm living with the illusion that this seems to loook correct (linux kernel poll code is too much magic for me). Thanks for your patch, queued up in drm-misc-next for 5.8.
Cheers, Daniel
Quoted 31 lines
--- drivers/gpu/drm/drm_file.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/gpu/drm/drm_file.c +4
-2@@ -608,7 +608,8 @@ ssize_t drm_read(struct file *filp, char __user *buffer, file_priv->event_space -= length;list_add (&e->link, &file_priv->event_list);spin_unlock_irq (&dev->event_lock); -wake_up_interruptible (&file_priv->event_wait); +wake_up_interruptible_poll (&file_priv->event_wait, +EPOLLIN |EPOLLRDNORM );break ; }@@ -804,7 +805,8 @@ void drm_send_event_locked(struct drm_device *dev, struct drm_pending_event *e)list_del (&e->pending_link);list_add_tail (&e->link, &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);Signature · 1 line
2.26.1
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx