[Mesa-dev] [PATCH 2/2] panfrost: Add madvise support to BO cache

Rob Herring robh at kernel.org
Fri Aug 9 22:53:22 UTC 2019


On Fri, Aug 9, 2019 at 2:49 PM Alyssa Rosenzweig
<alyssa.rosenzweig at collabora.com> wrote:
>
> I'm not one to care, but fwiw, spacing is inconsistent..?

Context? I guess you mean the 'madv.retained = 0;' line.

>
> > +                     if (!ret && !madv.retained) {
>
> What's the logic here? (What does a 0/!0 return code mean here?) I'm
> wondering if this meant to be ||?
>
> Or is the idea that an older kernel will have ret!=0 (since it doesn't
> recognize the ioctl) and therefore BOs won't be released, whereas new
> kernels will have ret==0 and then retained=0 if it needs to be released?

Yes. Any error whether madvise is supported or not is just treated as
never having made the ioctl call. The only error we can get is handle
lookup failing.

I could perhaps simplify this by initializing madv.retained to 1 and
never checking the return.

Rob


More information about the mesa-dev mailing list