Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp901750ybi; Fri, 2 Aug 2019 06:13:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqyCGEhcwzJ/AhoTH+PQT43vg30oH3VvFI6SOpci65hKfOGeRA6BuH+u/ESBhdAMMkTiOy7t X-Received: by 2002:a65:68c9:: with SMTP id k9mr90736448pgt.17.1564751594534; Fri, 02 Aug 2019 06:13:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564751594; cv=none; d=google.com; s=arc-20160816; b=p3n60tKyeEYJuAC3Xi2PuCq7iMKct3Qm8SVwzExeETqv2yQ9py3p3WiA036eyxyhjm /iM5NGAY5DxR47emZkbZPpBFZ4qQGAnHX+q/s7971aNT9by3yMB9BmAaaGY+axReeeDz mNmkzHm55fJKV0V0QMvfFrX+qat0qnvbikkfE8jYPW5qJ6vjSKWoCfSoQln+NiSryq6a kYJ2BCUlx9f/DVLVwJmkXIyMNNd4W8VGqLMgECGjMqzaVbv3RUZINscAbI+TxnuGPtnv eVuWoh2SzuhiAG+ZB6wingia2oa5ZEnXZjp3RMld0VSrYVF8elIsGqa2h1eQHyJyMwas t9TQ== 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=V5JBk0KOeP+O6db7cXBQIN0Onn7d7WIfpWUDwQjDrZY=; b=kduPPKpAKmfi7BZieyz4mV3EYpFpIGAtwI2HQ2AgA79SiqcY25eUNfoZeGKN+va+KR +zfLUfoqPh//WhHaBAEV/cYp4WXqzSmhI4BsL3EvFfhPVhhGuu0KRNnTlbruYgk5a011 znuMHPa+0Toqbzgzi2oET2Hyro3CNqHqV7Ce5ktho2vU9sGLJhut/J4FMcVQbjHEWISo JW8OfGBJ6C2leUzvyPYWJYMzjnD5FeirntxqFZiN5cq7O+zegh/XEJm4Nnh8iZhiCsKx fx6Wl7cAswFaXWaV2Z59EOFFVJRdai5iuUxtntyIdmymSH2FWlkPv7A5Wpy/IcIxiYwU dTPA== 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 o3si9214517plb.238.2019.08.02.06.12.59; Fri, 02 Aug 2019 06:13:14 -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 S2403775AbfHBICu (ORCPT + 99 others); Fri, 2 Aug 2019 04:02:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44944 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728268AbfHBICu (ORCPT ); Fri, 2 Aug 2019 04:02:50 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CEE058535D; Fri, 2 Aug 2019 08:02:49 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-81.ams2.redhat.com [10.36.116.81]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5C4FF19C68; Fri, 2 Aug 2019 08:02:48 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id B04BF16E05; Fri, 2 Aug 2019 10:02:45 +0200 (CEST) Date: Fri, 2 Aug 2019 10:02:45 +0200 From: Gerd Hoffmann To: Chia-I Wu Cc: dri-devel@lists.freedesktop.org, David Airlie , Daniel Vetter , virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/virtio: kick vq outside of the vq lock Message-ID: <20190802080245.za2n5rgx763xvhpd@sirius.home.kraxel.org> References: <20190711022937.166015-1-olvaffe@gmail.com> <20190711023959.170158-1-olvaffe@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190711023959.170158-1-olvaffe@gmail.com> User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 02 Aug 2019 08:02:50 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > @@ -291,11 +291,9 @@ static int virtio_gpu_queue_ctrl_buffer_locked(struct virtio_gpu_device *vgdev, > trace_virtio_gpu_cmd_queue(vq, > (struct virtio_gpu_ctrl_hdr *)vbuf->buf); > > - virtqueue_kick(vq); > + ret = virtqueue_kick_prepare(vq); > } > > - if (!ret) > - ret = vq->num_free; Hmm. Change looks unrelated. On a closer look it seems this is basically dead code. virtio_gpu_queue_ctrl_buffer_locked is called by virtio_gpu_queue_ctrl_buffer and virtio_gpu_queue_fenced_ctrl_buffer. The call sites for these two functions all ignore the return value. So it is a valid change, but it should go to a separate patch. And while being at it virtio_gpu_queue_ctrl_buffer and virtio_gpu_queue_fenced_ctrl_buffer can be changed to return void. Otherwise the patch looks fine. Nice analysis btw. cheers, Gerd