Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754170AbdFWQks convert rfc822-to-8bit (ORCPT ); Fri, 23 Jun 2017 12:40:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33696 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753786AbdFWQkq (ORCPT ); Fri, 23 Jun 2017 12:40:46 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 7731361D05 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=alex.williamson@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 7731361D05 Date: Fri, 23 Jun 2017 10:40:43 -0600 From: Alex Williamson To: Gerd Hoffmann Cc: Zhi Wang , "Wang, Zhenyu Z" , "intel-gfx@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" , "Chen, Xiaoguang" , "Zhang, Tina" , Kirti Wankhede , "Lv, Zhiyuan" , "intel-gvt-dev@lists.freedesktop.org" Subject: Re: [Intel-gfx] [PATCH v9 5/7] vfio: Define vfio based dma-buf operations Message-ID: <20170623104043.7f3505af@w520.home> In-Reply-To: <1498206688.24807.5.camel@redhat.com> References: <1497513611-2814-1-git-send-email-xiaoguang.chen@intel.com> <1497513611-2814-6-git-send-email-xiaoguang.chen@intel.com> <1497542438.29252.1.camel@redhat.com> <20170615143833.7526351b@w520.home> <24c4880b-24f5-ea07-834c-c77d3e895c78@nvidia.com> <1497854312.4207.4.camel@redhat.com> <20170619085530.1f5e46dc@w520.home> <237F54289DF84E4997F34151298ABEBC7C56EBE0@SHSMSX101.ccr.corp.intel.com> <1497956256.16795.7.camel@redhat.com> <20170620090004.44ac7fbc@w520.home> <237F54289DF84E4997F34151298ABEBC7C56F3DC@SHSMSX101.ccr.corp.intel.com> <20170620172204.09405cf4@w520.home> <237F54289DF84E4997F34151298ABEBC7C56F843@SHSMSX101.ccr.corp.intel.com> <1498043011.5802.5.camel@redhat.com> <20170621125938.1a92abda@w520.home> <1498120215.25651.5.camel@redhat.com> <20170622125458.01c953ab@w520.home> <1498202819.24807.3.camel@redhat.com> <594CC7F6.7050507@intel.com> <1498206688.24807.5.camel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 23 Jun 2017 16:40:46 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1340 Lines: 31 On Fri, 23 Jun 2017 10:31:28 +0200 Gerd Hoffmann wrote: > On Fri, 2017-06-23 at 15:49 +0800, Zhi Wang wrote: > > Hi: > >      Thanks for the discussions! If the userspace application has  > > already maintained a LRU list, it looks like we don't need > > generation  > > anymore, > > generation isn't required, things are working just fine without that. > It is just a small optimization, userspace can skip the LRU lookup > altogether if the generation didn't change. > > But of couse that only pays off if the kernel doesn't has to put much > effort into maintaining the generation id. Something simple like > increasing it each time the guest writes a register which affects > plane_info. But it seems like that simple management algorithm pretty much guarantees that the kernel will never revisit a generation and therefore caching dmabuf fds is pointless. AIUI the optimization is to allow userspace to 'at a glance' test one plane_info vs another. The user could also do this with a memcmp of the plane_info structs if that's its only purpose. A randomly incremented field within that struct could actually be a hindrance to the user for such a comparison. Are there cases where the plane_info struct is otherwise identical where the user would need to get a new dmabuf fd anyway? Thanks, Alex