Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2506657ybi; Thu, 4 Jul 2019 12:34:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqxnl6/0QDEPh0fbukbAn8c0PnnzN3rq0buKAu5fXo2AizDI9uzzbKOzz/Hct8U8wZo4W/cI X-Received: by 2002:a17:90a:9604:: with SMTP id v4mr1233629pjo.66.1562268896985; Thu, 04 Jul 2019 12:34:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562268896; cv=none; d=google.com; s=arc-20160816; b=S+jRFeowq4fXDpV39mor+CPXqbOzj7cw5Kds3AWs1kKWWVIrJNv9OkGr/L6t/nQfHS SfUBFK3v2zFusMTZYUggtyNVE/UDByLnhUxc9FsB1j1WCRlYUBJNuC0POHUAPENhZIBA z8oKqPXc+7WVjwseEhVsZeeOXVSQkzlb9v3MYjH1Rkr6k+PgBlUULk4svXyjeyqI51bM Gg5TUy3qx8+0KMEtfZN0NMlR2NyLrAy3qYakEF9/NP2ZIC9UJEy0h5cwmVJcP7AzqzbP JhodEcPMCNtefS8uwVDWZ/DxcyaXlTCddYxu7WrTcjq4iBsw8URynzCCx/4RIUIi6BJZ aDfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=LCuBLDKrofsuoqhEiEo5+1hJatvhFnFN7oOLzAEnyM4=; b=qJmCyxABH51ixWwx/G1+G6wZb4uRNIb9DpSiZxckWL+vEWhUIa/TGYaFhBU6G5uzge RoDjrW3vSbgT7RSWtUnTK52Oy0IALG47/QpH5jOb3PsT2cGaIMBWdUo2+fJJ4gk8MzaD R3D1qE3GMlD1hwn+wg4uCzyecwrRaxxGjY9FmX6BFzEKsbJ2LVxQEhVub/9BVn33hviI 9+Y9s9za5gTxiLD4e/WPjyxqjN08qByA/wQMy1lurSkpjMyMzuIaKW77Pj2wgpntB/ls iuePignS9jctqGtMuDPtT/xhAh1OTgohrqRS7t9i50jKLJDWkRFKD4JkLUHisaAZF3FO y5rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bhvxBO8Q; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j31si6053078pgi.151.2019.07.04.12.34.42; Thu, 04 Jul 2019 12:34:56 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bhvxBO8Q; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726916AbfGDTSA (ORCPT + 99 others); Thu, 4 Jul 2019 15:18:00 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:43330 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725865AbfGDTSA (ORCPT ); Thu, 4 Jul 2019 15:18:00 -0400 Received: by mail-io1-f66.google.com with SMTP id k20so14587154ios.10 for ; Thu, 04 Jul 2019 12:17:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LCuBLDKrofsuoqhEiEo5+1hJatvhFnFN7oOLzAEnyM4=; b=bhvxBO8QMlxGiuh/BsyudtWPQFUjQ5R9CUOpdTYaaqZyQ8vlvu/++aMUwi7JPKLthb TUMk35QeF5dolWl0Sim+RKa834/lE/WsTIuTlbDF0ehQm3t97BMJEahLPFrS4EXBmrvQ hGtjekw2DVmTrMgyT5cq43Ydrv1tI2BXhhH3cd0rbshvREhTgk+eN0E0HZlra+7rkBII JQEe1bSGSfbPaEhX75Miqqh4xtrQ3u9LzWU9zuiHUi3vu+v8zyPfDbrkdvRsfhQjXdI5 jVqTZNVX15sFR7jJRcTntloFNUV9B9Y1sW8SJF4UfOj7XMQDbr6QIZ47Tbbb+X1jaXSp 4BDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LCuBLDKrofsuoqhEiEo5+1hJatvhFnFN7oOLzAEnyM4=; b=NHzR21h+h+Tyccb4CWmU+3NKsi6dJqagSzv+6mL0OmHKIg2CXOjlSso88etH1Z7ubW zpxxJe6tceriamdp2DjKpsqfWMjHGIfKaAk61RtIn9vA6UtXQVZ3qisZb80Tl/j7U/Os mclO1D8q5aHLWn23EN2F48/zUcTcBm3ebEGr5KZxhcJ57mwod6HZjDksimGECJVtroLh IHQ60InuBCuOEzr2j4jKedm8lWADpMjDYAuR1ivT+gRWhzHyVvYYZ4w13RuLQpOerDio rxCSE0+Rsq5NFuXq6kuhJq3s4QkwROrUNS862cug3Q+Zss6JXdBnVxXxmy1svJx8gubI Px3Q== X-Gm-Message-State: APjAAAU1cvO1tbdd73j+7kIkprKNg6ZzuPYK7gXdpah4S3l3X371KKle tMaMwukeLNnaHmokjKTEV661wrmE4ExbqOsi4ko= X-Received: by 2002:a6b:6012:: with SMTP id r18mr5966278iog.241.1562267879466; Thu, 04 Jul 2019 12:17:59 -0700 (PDT) MIME-Version: 1.0 References: <20190702141903.1131-1-kraxel@redhat.com> <20190702141903.1131-7-kraxel@redhat.com> <20190704111043.5ubc2yjrjphj2iec@sirius.home.kraxel.org> In-Reply-To: <20190704111043.5ubc2yjrjphj2iec@sirius.home.kraxel.org> From: Chia-I Wu Date: Thu, 4 Jul 2019 12:17:48 -0700 Message-ID: Subject: Re: [PATCH v6 06/18] drm/virtio: remove ttm calls from in virtio_gpu_object_{reserve,unreserve} To: Gerd Hoffmann Cc: ML dri-devel , Gurchetan Singh , David Airlie , Daniel Vetter , "open list:VIRTIO GPU DRIVER" , open list Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. I can be wrong, but on the other hand, it seems fine for a BO to go away before the vbuf using it is retired. When that happens, the driver emits a RESOURCE_UNREF vbuf which is *after* the original vbuf. > > cheers, > Gerd >