From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754651AbdFWJrW (ORCPT ); Fri, 23 Jun 2017 05:47:22 -0400 Received: from mga05.intel.com ([192.55.52.43]:60659 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754457AbdFWJrV (ORCPT ); Fri, 23 Jun 2017 05:47:21 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,377,1493708400"; d="scan'208";a="117961792" Message-ID: <594CE0AF.9070402@intel.com> Date: Fri, 23 Jun 2017 17:34:39 +0800 From: Zhi Wang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Gerd Hoffmann CC: Alex Williamson , "Wang, Zhenyu Z" , intel-gfx@lists.freedesktop.org, "linux-kernel@vger.kernel.org" , "Zhang, Tina" , kwankhede@nvidia.com, Zhiyuan Lv , "intel-gvt-dev@lists.freedesktop.org" Subject: Re: [kraxel@redhat.com: Re: [Intel-gfx] [PATCH v9 5/7] vfio: Define vfio based dma-buf operations] References: <20170623092553.7cckmv43fmdxnbmq@zhen-hp.sh.intel.com> In-Reply-To: <20170623092553.7cckmv43fmdxnbmq@zhen-hp.sh.intel.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Gred and Alex: Thanks for the reply! It would be better that kernel only provides functions instead of maintaining states from my point of view. If there is any existing async notification channel in vfio device fd? like reporting device events from vfio to QEMU? If so, It would be nice if we can extend that channel and notify the userspace application that guest framebuffer changed via that channel. So userspace application even doesn't need to call the ioctl periodically. :) If VM runs a single-buffered application. Thanks, Zhi. 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. > > If you think it doesn't make sense from the driver point of view we can > drop the generation. > > cheers, > Gerd