Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp510184ybz; Wed, 29 Apr 2020 04:28:40 -0700 (PDT) X-Google-Smtp-Source: APiQypKSFHN+IKmKU7SkrWDR5p36/qZJjQh72yJZZxmCbzRI3pjq8R9a/+wj46QbXcpLB6LXEFM7 X-Received: by 2002:a50:baa6:: with SMTP id x35mr2047290ede.54.1588159720357; Wed, 29 Apr 2020 04:28:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588159720; cv=none; d=google.com; s=arc-20160816; b=0N63yeKtySbPtqvZl+JvVWCEOi4rJ3OKsmLOr2pqqs0k3HmC7xszMEW39Wq59I4Sks 2qMKFkiPnQ2PaZp1zCTCtRQzQbZ10zPc6XvYTBuzIgzYbM9gkeU15IAyTaakGaP3cl7q LIIsDWZk46gC7tX2rFbDCrVHP2s6xfUbu6ZaKgFAtCU6oHX6li7uangrkevG7dnI/HDn Ph7ZDrfJgZQJl1/5ommDp2VfPbTuqnVtl4U4y5/+beBS4HrdzAinxI9xIaqczGSWiP3x 6heLTf3PvgBjFnFGhdb1aSOjlNcjeGTvfyxJ2t57AEf4ksDFuJcq/+opTOT+Jk92Aatl PIAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:cc:to:subject :message-id:from:content-transfer-encoding:date:dkim-signature :mime-version; bh=imyH5i/2Y9yMNzm7UXaBN/+s9A++43Lu0do6gm4lZAo=; b=ruF3HTTipPpqkz24nzzHOSwx6nW+HMe2QczUhNOXNZd1c6Dt/FbJikFr8X0EOEkKjq IzQpP/ibD/k9ESf+RMQRuVmaQBnUScM5UC5iVS2cxbnFbpWg5TEXNfwL/GpTfendthgW PU7DC6NIu7SxwgAlhaBeKlcofSsGTvcD+6ncKMFUHINvJkUogDycVVCJ3KHihXK97HSW Hyo5C4gAFRaSZg/yiVF3HQq04hF2dDIxREkKbLk5kBYN2D03x8+SicFbLfUT+0z6Ncmh RTyYf7wM6NL/KzINgvXDTKiXdTNE5oMgY6LLoR/CWLJ33UM7WSs8HQDH9qRVaPuBPKBz AyWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kl.wtf header.s=default header.b=LrdIfbup; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kl.wtf Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y4si3134358edi.166.2020.04.29.04.28.16; Wed, 29 Apr 2020 04:28:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kl.wtf header.s=default header.b=LrdIfbup; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kl.wtf Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726554AbgD2L0k (ORCPT + 99 others); Wed, 29 Apr 2020 07:26:40 -0400 Received: from out1.migadu.com ([91.121.223.63]:54796 "EHLO out1.migadu.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726345AbgD2L0k (ORCPT ); Wed, 29 Apr 2020 07:26:40 -0400 X-Greylist: delayed 449 seconds by postgrey-1.27 at vger.kernel.org; Wed, 29 Apr 2020 07:26:39 EDT 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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" Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, airlied@linux.ie, tzimmermann@suse.de, mripard@kernel.org, maarten.lankhorst@linux.intel.com, linux-kernel@vger.kernel.org In-Reply-To: <20200428151410.GU3456981@phenom.ffwll.local> References: <20200428151410.GU3456981@phenom.ffwll.local> <20200424162615.10461-1-kl@kl.wtf> X-Spam-Score: -0.10 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org April 28, 2020 5:14 PM, "Daniel Vetter" wrote:=0A=0A> O= n Fri, Apr 24, 2020 at 06:26:15PM +0200, Kenny Levinsen wrote:=0A> =0A>> = Some processes, such as systemd, are only polling for EPOLLERR|EPOLLHUP.= =0A>> As drm_file uses unkeyed wakeups, such a poll can receive many spur= ious=0A>> wakeups from uninteresting events if, for example, the file des= cription=0A>> is subscribed to vblank events. This is the case with syste= md, as it=0A>> polls a file description from logind that is shared with t= he users'=0A>> compositor.=0A>> =0A>> Use keyed wakeups to allow the wake= up target to more efficiently discard=0A>> these uninteresting events.=0A= >> =0A>> Signed-off-by: Kenny Levinsen =0A> =0A> Hm I applied = v1 and I'm not spotting what's different here, and there's no=0A> changel= og explaining what changed ...=0A> =0A> Please send a fixup if there's an= ything important missing.=0A> -Daniel=0A>=0A=0AIt's only the summary that= differed as you and sravn requested in #dri-devel, so it's probably fine= .=0A=0AI should have explained the change. I'm still trying to get the ha= ng of the email-based workflow. :)=0A=0ABest regards,=0AKenny Levinsen=0A= =0A>> ---=0A>> drivers/gpu/drm/drm_file.c | 6 ++++--=0A>> 1 file changed,= 4 insertions(+), 2 deletions(-)=0A>> =0A>> diff --git a/drivers/gpu/drm/= drm_file.c b/drivers/gpu/drm/drm_file.c=0A>> index c4c704e01961..ec25b3d9= 79d9 100644=0A>> --- a/drivers/gpu/drm/drm_file.c=0A>> +++ b/drivers/gpu/= drm/drm_file.c=0A>> @@ -608,7 +608,8 @@ ssize_t drm_read(struct file *fil= p, char __user *buffer,=0A>> file_priv->event_space -=3D length;=0A>> lis= t_add(&e->link, &file_priv->event_list);=0A>> spin_unlock_irq(&dev->event= _lock);=0A>> - wake_up_interruptible(&file_priv->event_wait);=0A>> + wake= _up_interruptible_poll(&file_priv->event_wait,=0A>> + EPOLLIN | EPOLLRDNO= RM);=0A>> break;=0A>> }=0A>> =0A>> @@ -804,7 +805,8 @@ void drm_send_even= t_locked(struct drm_device *dev, struct drm_pending_event *e)=0A>> list_d= el(&e->pending_link);=0A>> list_add_tail(&e->link,=0A>> &e->file_priv->ev= ent_list);=0A>> - wake_up_interruptible(&e->file_priv->event_wait);=0A>> = + wake_up_interruptible_poll(&e->file_priv->event_wait,=0A>> + EPOLLIN | = EPOLLRDNORM);=0A>> }=0A>> EXPORT_SYMBOL(drm_send_event_locked);=0A>> =0A>= > --=0A>> 2.26.1=0A> =0A> --=0A> Daniel Vetter=0A> Software Engineer, Int= el Corporation=0A> http://blog.ffwll.ch