Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp3111860ybd; Fri, 28 Jun 2019 03:06:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqx32WYXTXkvBdOcw1QFJ6TwR5c2kedY9vmID0gF1zBRqjQaZTGUW4O978YlGnkO6wYD1Om4 X-Received: by 2002:a17:90a:d80b:: with SMTP id a11mr11511471pjv.53.1561716360636; Fri, 28 Jun 2019 03:06:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561716360; cv=none; d=google.com; s=arc-20160816; b=u3jiWuZwFV4ab2srnM/glnz1U9VeBqH89ellfQX6MuRgVf/fR3d8wTEIF8z7j2y+wP 0lXoyZqdVAeXTTp4V+Bnet3WwP1kD1l0fBQfTy8gG6G3EHGQYgffMT1ZHTfPY0cUtq1H LDWILTU/CQ2i5ZDAneEpi3e27Wz01+rLzJer5Ig/p5rn7FD9yrIGoXXPrmrgEVTXtMFl 7cgVyu1dA5MtLIXPkHpZ8ZvLifQw8dU2NMf5uxKNto5Ejx1bRZBwum3HqEpIjYOuzoqi qm4fv39J9nQ6Jbp0PND2SwNKbwI5z9npkbEhcGLZbQ2mRi305c7TdvIPRaDNcJHx6gIj pbCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=AExC70JtvFk5jbykPCqPfi2uJFcMT73hrOkh8nxeiB8=; b=asbUDidf1rNySmYKw1lKF256clH910/S1QWJqFsZZO3h+4KKIxh8nD7O1LGX1ji9nf A5yFtO+xxP7xYdN/95ZMCsTSWzj5pxz3OWiZ32HPUbFYVDBeY/UFFgrHe/NqVJfY8lMF Mx/NNk/Ykc5skEAUN+37JH3jWE964t5DGYC3Os0qbBfPtWn9wttP/C3tZc22IR1HB2rq OuVg0poeakH8xT35olSTHVwweR7vtfsDK2248g0tQbRQG8LqS4KyOCNVlmbxO83077bO GcTaQ0ubmLQG+VrfNvEuB0AVpc9i3bY8WmFgsZsrry16p3P8m++KuZukWxxzBWbg7ZMo G81Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f4si1799087plb.38.2019.06.28.03.05.43; Fri, 28 Jun 2019 03:06:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726597AbfF1KFZ (ORCPT + 99 others); Fri, 28 Jun 2019 06:05:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55710 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726508AbfF1KFZ (ORCPT ); Fri, 28 Jun 2019 06:05:25 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3F123307D840; Fri, 28 Jun 2019 10:05:20 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-96.ams2.redhat.com [10.36.116.96]) by smtp.corp.redhat.com (Postfix) with ESMTP id CC68F5C21A; Fri, 28 Jun 2019 10:05:17 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id BBA7A11AA3; Fri, 28 Jun 2019 12:05:16 +0200 (CEST) Date: Fri, 28 Jun 2019 12:05:16 +0200 From: Gerd Hoffmann To: Chia-I Wu Cc: ML dri-devel , David Airlie , open list , "open list:VIRTIO GPU DRIVER" Subject: Re: [PATCH v4 02/12] drm/virtio: switch virtio_gpu_wait_ioctl() to gem helper. Message-ID: <20190628100516.yrtiuxemyt4hvyra@sirius.home.kraxel.org> References: <20190620060726.926-1-kraxel@redhat.com> <20190620060726.926-3-kraxel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Fri, 28 Jun 2019 10:05:25 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 26, 2019 at 04:55:20PM -0700, Chia-I Wu wrote: > On Wed, Jun 19, 2019 at 11:07 PM Gerd Hoffmann wrote: > > > > Use drm_gem_reservation_object_wait() in virtio_gpu_wait_ioctl(). > > This also makes the ioctl run lockless. > The userspace has a BO cache to avoid freeing BOs immediately but to > reuse them on next allocations. The BO cache checks if a BO is busy > before reuse, and I am seeing a big negative perf impact because of > slow virtio_gpu_wait_ioctl. I wonder if this helps. Could help indeed (assuming it checks with NOWAIT). How many objects does userspace check in one go typically? Maybe it makes sense to add an ioctl which checks a list, to reduce the system call overhead. > > + if (args->flags & VIRTGPU_WAIT_NOWAIT) { > > + obj = drm_gem_object_lookup(file, args->handle); > Don't we need a NULL check here? Yes, we do. Will fix. thanks, Gerd