Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp274599ybv; Thu, 6 Feb 2020 22:47:47 -0800 (PST) X-Google-Smtp-Source: APXvYqx6b4Wq+m5zirmu/JJXXDysPamCLOksicQv0EAYD9rIORoCaY8JGqXCqlXLO3o4UunDY8xu X-Received: by 2002:a9d:7508:: with SMTP id r8mr1588382otk.116.1581058067820; Thu, 06 Feb 2020 22:47:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581058067; cv=none; d=google.com; s=arc-20160816; b=SXm4rIb0F0iY5Cw6WB/VEZCCDylBxOi7QctBFLfwGOZ7H8Di2y+5r5HiiKMzssMO0S wbTxXdov4fsbdAnWpRZ7GjwPcESZygogSKjfU5R+FfWG8Y65/9SO3d2bQCcqXjSlLSu/ ptp9muJmFqg/0UiV3tAF+KZ8FWzY0k58TEusJw0DwEk45ns0HGQtAqTmmg+NeOFUIW9J OtFyzkgStTQLoinLGuvWGgM9bPQL31wHJCb0ixTGP7jV1Yq0XBCZSBnoJj3g3v9qkN4W dwG//3V7WRcG1i2tFNlUPApfasvMDxhwy/evn/wFfWW9MhNxJ+N6EocZV/O2WEPkMKCr znoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=JR0sLKJMwOjHuo0gNvxLVg3cMealajs17yiRzMpKjW0=; b=cOYuML3ycInTyWLC0+e0+O1IhuADLmMHgGPUw9CvjmJv6Gw5hYByUm985AiGQ1/y0/ AnYCG2cdpr9uj4Z2btuRV1oumHkmofIidfKg3fKMal+NVg8pYK4pzArxvBsIvIVNGmly Es1FdK3IIVG333gj1Wqz47kKQKG+g53QR2bSisWfffE2Y+sxMOfpVLLkkD3gUeJswq4b MH7milDj3MKTwGozauKnLRpMvg7F6Yd0wLir1qOUv3loUcR3WuRLqU7mCne6oRgzw+h9 hszMGVmcT703cKYUiQ+062Q9nYtppCMYMrEdpNTVpO1qIiuqCube9ReqLqy05QgQYv9N D0pQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QcjjrCCP; 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=pass (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 x11si1169371otp.285.2020.02.06.22.47.35; Thu, 06 Feb 2020 22:47:47 -0800 (PST) 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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QcjjrCCP; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726626AbgBGGqj (ORCPT + 99 others); Fri, 7 Feb 2020 01:46:39 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:43697 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726136AbgBGGqi (ORCPT ); Fri, 7 Feb 2020 01:46:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581057997; 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: in-reply-to:in-reply-to:references:references; bh=JR0sLKJMwOjHuo0gNvxLVg3cMealajs17yiRzMpKjW0=; b=QcjjrCCPd5B9fPi1Jv96nzNS7Clcz1gAvdD8XknelfTGklbQJ4pSMVX4n9gyDVcrv+i3po iium72X9id9Vh88grfmBUQx9T3YuJtn2fyBe2MUbsMfhng3ADI05HSOByySJC9Gi74bD91 Ug4f3yyQm+bvzccswHGocozQ5EarUBY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-4-jrthkPVwN3SST0AZHHhljw-1; Fri, 07 Feb 2020 01:46:33 -0500 X-MC-Unique: jrthkPVwN3SST0AZHHhljw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F332E8010CA; Fri, 7 Feb 2020 06:46:31 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-112.ams2.redhat.com [10.36.116.112]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7F0B45DA7C; Fri, 7 Feb 2020 06:46:31 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id BCC461FCD6; Fri, 7 Feb 2020 07:46:30 +0100 (CET) Date: Fri, 7 Feb 2020 07:46:30 +0100 From: Gerd Hoffmann To: Chia-I Wu Cc: ML dri-devel , Gurchetan Singh , David Airlie , Daniel Vetter , "open list:VIRTIO GPU DRIVER" , open list Subject: Re: [PATCH] drm/virtio: fix ring free check Message-ID: <20200207064630.6p35spqres676cpq@sirius.home.kraxel.org> References: <20200206111416.31269-1-kraxel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, > > + indirect = virtio_has_feature(vgdev->vdev, VIRTIO_RING_F_INDIRECT_DESC); > > + vqcnt = indirect ? 1 : elemcnt; > Is the feature dynamic and require the lock held? If not, the result > can be cached and the fixup can happen before grabbing the lock Not dynamic, so yes, caching makes sense. cheers, Gerd