From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4C8D0C83002 for ; Thu, 30 Apr 2020 07:32:12 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1DEA820757 for ; Thu, 30 Apr 2020 07:32:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kl.wtf header.i=@kl.wtf header.b="LrdIfbup" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1DEA820757 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kl.wtf Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C981F6EB50; Thu, 30 Apr 2020 07:31:57 +0000 (UTC) Received: from out1.migadu.com (out1.migadu.com [IPv6:2001:41d0:2:863f::]) by gabe.freedesktop.org (Postfix) with ESMTPS id 822A76E061 for ; Wed, 29 Apr 2020 11:19:13 +0000 (UTC) MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kl.wtf; s=default; t=1588159147; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=imyH5i/2Y9yMNzm7UXaBN/+s9A++43Lu0do6gm4lZAo=; b=LrdIfbupDauYnhNB/LVW7socv26n2fC4hjUAyHuPXJNEkxTUwwClvoDTrPINu4HaMhyLgo 2rAzNOU032gKGBlrYK/tFlmA75qh/N18BQ6tDUJLLelE+4b/sKqm4B7YwCj+vx8S6HsmSc AY1CCPyS+l3NPDGicr7OJQ8/QFbU5I0= Date: Wed, 29 Apr 2020 11:19:07 +0000 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: kl@kl.wtf Message-ID: Subject: Re: [PATCH v2] drm: make drm_file use keyed wakeups To: "Daniel Vetter" In-Reply-To: <20200428151410.GU3456981@phenom.ffwll.local> References: <20200428151410.GU3456981@phenom.ffwll.local> <20200424162615.10461-1-kl@kl.wtf> X-Mailman-Approved-At: Thu, 30 Apr 2020 07:31:56 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: airlied@linux.ie, intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, tzimmermann@suse.de Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" April 28, 2020 5:14 PM, "Daniel Vetter" wrote: > On Fri, Apr 24, 2020 at 06:26:15PM +0200, Kenny Levinsen wrote: > >> Some processes, such as systemd, are only polling for EPOLLERR|EPOLLHUP. >> As drm_file uses unkeyed wakeups, such a poll can receive many spurious >> wakeups from uninteresting events if, for example, the file description >> is subscribed to vblank events. This is the case with systemd, as it >> polls a file description from logind that is shared with the users' >> compositor. >> >> Use keyed wakeups to allow the wakeup target to more efficiently discard >> these uninteresting events. >> >> Signed-off-by: Kenny Levinsen > > Hm I applied v1 and I'm not spotting what's different here, and there's no > changelog explaining what changed ... > > Please send a fixup if there's anything important missing. > -Daniel > It's only the summary that differed as you and sravn requested in #dri-devel, so it's probably fine. I should have explained the change. I'm still trying to get the hang of the email-based workflow. :) Best regards, Kenny Levinsen >> --- >> 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 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel