[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170623104043.7f3505af@w520.home>
Date: Fri, 23 Jun 2017 10:40:43 -0600
From: Alex Williamson <alex.williamson@...hat.com>
To: Gerd Hoffmann <kraxel@...hat.com>
Cc: Zhi Wang <zhi.a.wang@...el.com>,
"Wang, Zhenyu Z" <zhenyu.z.wang@...el.com>,
"intel-gfx@...ts.freedesktop.org" <intel-gfx@...ts.freedesktop.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"Chen, Xiaoguang" <xiaoguang.chen@...el.com>,
"Zhang, Tina" <tina.zhang@...el.com>,
Kirti Wankhede <kwankhede@...dia.com>,
"Lv, Zhiyuan" <zhiyuan.lv@...el.com>,
"intel-gvt-dev@...ts.freedesktop.org"
<intel-gvt-dev@...ts.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH v9 5/7] vfio: Define vfio based dma-buf
operations
On Fri, 23 Jun 2017 10:31:28 +0200
Gerd Hoffmann <kraxel@...hat.com> 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
Powered by blists - more mailing lists