Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1292934ybk; Thu, 14 May 2020 05:32:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpJ38/1ixL94/NfSdCJB/GQR8YIw9zSlVkFeTUa5tYJYQbWgy3NV4cEXQ0aZH75hm5wmK7 X-Received: by 2002:a05:6402:17a3:: with SMTP id j3mr3868304edy.137.1589459527862; Thu, 14 May 2020 05:32:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589459527; cv=none; d=google.com; s=arc-20160816; b=sggKOG2+hRbj+8BMcsQPFpVhWOtMP/hLBF5KLHm63afInQgUsWcNGT9YTnQPJWGryf JrTkyyDUhg5gjmjsexyHyQZ2XPokqR7fGMCOHMId3Du4baX3qeq3kD+pj2GwJ2MIOuID VaouCF0+8xqrRrBr12UTSOhg6Cxv/uBdwCFvz0AZJq6G9No6LYyWOGQ5ikR5aEKyrGs+ VcgDMK/fbwQTDPW6Rd5dI6Nq7TYivbF5DwQMRSWScBRbUmhNkN9zNxyUIruioNhaM7WC 9q4DzSUg44zV8A9L0oNs7XmZxKc11Pz5JlLkLTkiqQFPuaIAk4e62ZS6nwelTxABTouh uAvw== 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:mail-followup-to:message-id:subject:cc:to :from:date:dkim-signature; bh=J2ZtatzqD3OE8VdsdW4HBUMkQqixlxQVBQrLMq5CUUY=; b=Cf7kauatFGbReUnxwQo9nQgGh8VcnmS1RtyndYs9CE+hQIkr3vQUZZREBG6ZWHdxle WJY0+OKhgnCihMQQZSsTSUWOlu8VgFoXL/pykzdqCS/c5CERp0AYyQ+/OP4eUpBvGdUl oLggI4JcMZ5FfheCFSRTcKW4v0UkCZC7SJQ1mqeeNEm0oG+tY4VB3o9wKQzJVTxJBWGs JvgE/Ko3g2EHX8yPIafikYYrgD9xeA2WisivNIDP+4uoi+FLAc4RerN+q6XmUxs0epJ/ MBqg+HGsTTRgE3rV6oBlRCgqjSTsyvwZQ8KiSwlYTrdaM40nMc+B/RqmYq6CBqor0PFs xIjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b="cna/1t9S"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i12si1699584edn.103.2020.05.14.05.31.44; Thu, 14 May 2020 05:32:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b="cna/1t9S"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726160AbgENMaO (ORCPT + 99 others); Thu, 14 May 2020 08:30:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725925AbgENMaN (ORCPT ); Thu, 14 May 2020 08:30:13 -0400 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6219C061A0C for ; Thu, 14 May 2020 05:30:11 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id l18so3810634wrn.6 for ; Thu, 14 May 2020 05:30:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=J2ZtatzqD3OE8VdsdW4HBUMkQqixlxQVBQrLMq5CUUY=; b=cna/1t9SJDeWhOllSyrFsbKx0FpSu+qU5vcjm9dCmgeETaVbC4scdE9YaQZa7xAhkr jHrdBmIyDJ83s6hG2UqR5xnjB9KlJDeexh3TNwXFT20K9xALDBUx8a5xF63UB4ckWqdz rmeI0Urauv7XBVMJ/YekgTPyJ+K5u+QxcAMms= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=J2ZtatzqD3OE8VdsdW4HBUMkQqixlxQVBQrLMq5CUUY=; b=pFWwFya4OxXZzlq7x9IrCE/Jelgl1pgwlj03uK/TsMRef2w+t1f2cB7yW+k8n4Qlak tPi5b7lg8i/2D8bRdk+7ITfSzddCPr5HHrjdtSCNvrjOFywnFUmxIpzYOP0GDrHy9OWU ctQ/ODjVXgxMYYV5HwNk5DDA/8V4lGG2i79t8l5aKDOWaRRVBsIKykQG5PcNBnd0h4mW yvSEDDXxKpkvvYpyyJJrwmgn66pE+ZXoHbekKfg6wBd2Sj78wpMGXiGgzlZH3Xqf4RwY kJFfGrc/Br4/lTDN6ZhqSNerXFlyqSp+daoFTB9Mj+pXz7TxNb8mt45ESTNg4fe1UVeD y2FQ== X-Gm-Message-State: AOAM5319gI9M/ojfE1TB9bUdkJ4oip1kwSMbzS/8sqdMiDns6W4IWw3q +TEEgiRg4B9CmnUEIk9IMdXBew== X-Received: by 2002:a5d:6283:: with SMTP id k3mr5203956wru.62.1589459410673; Thu, 14 May 2020 05:30:10 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id p7sm4269731wmg.38.2020.05.14.05.30.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 May 2020 05:30:09 -0700 (PDT) Date: Thu, 14 May 2020 14:30:07 +0200 From: Daniel Vetter To: David Stevens Cc: Daniel Vetter , Tomasz Figa , Gerd Hoffmann , David Airlie , "Michael S . Tsirkin" , Jason Wang , Sumit Semwal , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Linux Kernel Mailing List , dri-devel , "open list:VIRTIO CORE, NET..." , "open list:DMA BUFFER SHARING FRAMEWORK" , "moderated list:DMA BUFFER SHARING FRAMEWORK" , virtio-dev@lists.oasis-open.org Subject: Re: [PATCH v3 1/4] dma-buf: add support for virtio exported objects Message-ID: <20200514123007.GP206103@phenom.ffwll.local> Mail-Followup-To: David Stevens , Tomasz Figa , Gerd Hoffmann , David Airlie , "Michael S . Tsirkin" , Jason Wang , Sumit Semwal , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Linux Kernel Mailing List , dri-devel , "open list:VIRTIO CORE, NET..." , "open list:DMA BUFFER SHARING FRAMEWORK" , "moderated list:DMA BUFFER SHARING FRAMEWORK" , virtio-dev@lists.oasis-open.org References: <20200311112004.47138-1-stevensd@chromium.org> <20200311112004.47138-2-stevensd@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: Linux phenom 5.6.0-1-amd64 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 14, 2020 at 05:19:40PM +0900, David Stevens wrote: > Sorry for the duplicate reply, didn't notice this until now. > > > Just storing > > the uuid should be doable (assuming this doesn't change during the > > lifetime of the buffer), so no need for a callback. > > Directly storing the uuid doesn't work that well because of > synchronization issues. The uuid needs to be shared between multiple > virtio devices with independent command streams, so to prevent races > between importing and exporting, the exporting driver can't share the > uuid with other drivers until it knows that the device has finished > registering the uuid. That requires a round trip to and then back from > the device. Using a callback allows the latency from that round trip > registration to be hidden. Uh, that means you actually do something and there's locking involved. Makes stuff more complicated, invariant attributes are a lot easier generally. Registering that uuid just always doesn't work, and blocking when you're exporting? -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch