From: Daniel Vetter <daniel@ffwll.ch>
To: Kenny Levinsen <kl@kl.wtf>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
daniel@ffwll.ch, airlied@linux.ie, tzimmermann@suse.de,
mripard@kernel.org, maarten.lankhorst@linux.intel.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm: make drm_file use keyed wakeups
Date: Tue, 28 Apr 2020 17:11:44 +0200 [thread overview]
Message-ID: <20200428151144.GT3456981@phenom.ffwll.local> (raw)
In-Reply-To: <20200424145103.3048-1-kl@kl.wtf>
On Fri, Apr 24, 2020 at 04:51:03PM +0200, Kenny Levinsen wrote:
> 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>
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
> ---
> drivers/gpu/drm/drm_file.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu/drm/drm_file.c
> index c4c704e01961..ec25b3d979d9 100644
> --- a/drivers/gpu/drm/drm_file.c
> +++ b/drivers/gpu/drm/drm_file.c
> @@ -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);
>
> --
> 2.26.1
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
next prev parent reply other threads:[~2020-04-28 15:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-24 14:51 Kenny Levinsen
2020-04-28 15:11 ` Daniel Vetter [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-04-12 17:41 Kenny Levinsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200428151144.GT3456981@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=kl@kl.wtf \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®