Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3143616ybi; Fri, 5 Jul 2019 02:39:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqzBFLpPnF1B5rvAsY3ZEP8ZVNPew6S4ZvMSAQEtNwExevsI63io5g/yRXpXVk39xjqblKp8 X-Received: by 2002:a63:c302:: with SMTP id c2mr4084477pgd.300.1562319561833; Fri, 05 Jul 2019 02:39:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562319561; cv=none; d=google.com; s=arc-20160816; b=hEyP1vUgKpCZm0fVVJtqGZlogm3Kpg5/NqgtOKSr+MRD+S5bdz6o4imTrCCAE23+Pv g8YkYT9vYNtOchMU2KgQ2w8ORGNisTnmYQ8K4r4Co4IyJ9uDFl+kNzg4JPV7XlA1SNIV gQsaOnyv/iEtjtx57ZG/P2m4wygVf170J03DZGPgH0HoInTXAhE3GM4ht90PBY9oxzOa GWSeWhujMclFIRRcPPpvke5HqgqVpB4cmMsFUe1x+U2R3ra/tvy8bPCeLbWoX4ZmC8Un sqKTRrx1QBPPCuftImdxMAFHLmfP208TLTcPzQq4RafbaunievU9Ju+SozHkZIpQyw8I UWaA== 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=s9spPmZueFIm/OGcROSU/WavpInDE2zTJ8oLEsw050A=; b=b942+fnPflJPCa5U+rIf8j5ySG5S/Vb96gytlMvEA1rtnlSTXreepPHzB7RNyvuWKH uQ1pRZzqfj+kjqqGInXouiK3UCS1VGBB1wDWYCEgXfExdJjW0Hpg0S6+/N6pm4KKhN1v FSo6Ryq9I+MeOQH9O9gGSb7sROgZL4cm4tgj5fRa7xX5TnaTdoiDoKSJdNTtY/AFD6qM i1ywow7L8FVPpiycoo85YIE7f4lwSJd+ZKU2m8chs7tP8Prk6iVrvVqz1bzKvpJ+d6R2 TEo+pYObbsaRX+ewk+gmWc0aeslI/Eqp/56wnXOMQtqiJ9uwLqXqlhDfehBz+nkKsOgp p4SQ== 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 fr1si7453691pjb.57.2019.07.05.02.39.06; Fri, 05 Jul 2019 02:39:21 -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 S1728097AbfGEIxg (ORCPT + 99 others); Fri, 5 Jul 2019 04:53:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54488 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726427AbfGEIxg (ORCPT ); Fri, 5 Jul 2019 04:53:36 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3AE463079B68; Fri, 5 Jul 2019 08:53:26 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-90.ams2.redhat.com [10.36.116.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id D935C1001B20; Fri, 5 Jul 2019 08:53:25 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 10B3216E32; Fri, 5 Jul 2019 10:53:25 +0200 (CEST) Date: Fri, 5 Jul 2019 10:53:25 +0200 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 v6 06/18] drm/virtio: remove ttm calls from in virtio_gpu_object_{reserve,unreserve} Message-ID: <20190705085325.am2reucblvxc6qpg@sirius.home.kraxel.org> References: <20190702141903.1131-1-kraxel@redhat.com> <20190702141903.1131-7-kraxel@redhat.com> <20190704111043.5ubc2yjrjphj2iec@sirius.home.kraxel.org> 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.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Fri, 05 Jul 2019 08:53:36 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 04, 2019 at 12:17:48PM -0700, Chia-I Wu wrote: > On Thu, Jul 4, 2019 at 4:10 AM Gerd Hoffmann wrote: > > > > Hi, > > > > > > - r = ttm_bo_reserve(&bo->tbo, true, false, NULL); > > > > + r = reservation_object_lock_interruptible(bo->gem_base.resv, NULL); > > > Can you elaborate a bit about how TTM keeps the BOs alive in, for > > > example, virtio_gpu_transfer_from_host_ioctl? In that function, only > > > three TTM functions are called: ttm_bo_reserve, ttm_bo_validate, and > > > ttm_bo_unreserve. I am curious how they keep the BO alive. > > > > It can't go away between reserve and unreserve, and I think it also > > can't be evicted then. Havn't checked how ttm implements that. > Hm, but the vbuf using the BO outlives the reserve/unreserve section. > The NO_EVICT flag applies only when the BO is still alive. Someone > needs to hold a reference to the BO to keep it alive, otherwise the BO > can go away before the vbuf is retired. Note that patches 14+15 rework virtio_gpu_transfer_*_ioctl to keep gem reference until the command is finished and patch 17 drops virtio_gpu_object_{reserve,unreserve} altogether. Maybe I should try to reorder the series, then squash 6+17 to reduce confusion. I suspect that'll cause quite a few conflicts though ... cheers, Gerd