]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm: make drm_file use keyed wakeups
authorKenny Levinsen <kl@kl.wtf>
Fri, 24 Apr 2020 14:51:03 +0000 (16:51 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 28 Apr 2020 15:10:56 +0000 (17:10 +0200)
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: Kenny Levinsen <kl@kl.wtf>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200424145103.3048-1-kl@kl.wtf
drivers/gpu/drm/drm_file.c

index eb009d3ab48fa318ddd51dae56784d288ccef17d..7194e67e78bd2412bad54eab4dc5e1b5eeced463 100644 (file)
@@ -613,7 +613,8 @@ put_back_event:
                                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;
                        }
 
@@ -809,7 +810,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);