[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKv+Gu-6=kUd_OYoe4TpFSUXHqC4etxH98mAN_gkHKvS1=1BGA@mail.gmail.com>
Date: Thu, 24 Jan 2019 10:37:14 +0100
From: Ard Biesheuvel <ard.biesheuvel@...aro.org>
To: Michel Dänzer <michel@...nzer.net>
Cc: Christoph Hellwig <hch@...radead.org>,
Maxime Ripard <maxime.ripard@...tlin.com>,
Michael Ellerman <mpe@...erman.id.au>,
Will Deacon <will.deacon@....com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
amd-gfx list <amd-gfx@...ts.freedesktop.org>,
Junwei Zhang <Jerry.Zhang@....com>,
David Airlie <airlied@...ux.ie>, Huang Rui <ray.huang@....com>,
dri-devel <dri-devel@...ts.freedesktop.org>,
Alex Deucher <alexander.deucher@....com>,
Sean Paul <sean@...rly.run>,
Christian Koenig <christian.koenig@....com>,
linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>
Subject: Re: [RFC PATCH] drm: disable WC optimization for cache coherent
devices on non-x86
On Thu, 24 Jan 2019 at 10:31, Michel Dänzer <michel@...nzer.net> wrote:
>
> On 2019-01-23 5:52 p.m., Ard Biesheuvel wrote:
> > On Wed, 23 Jan 2019 at 17:44, Christoph Hellwig <hch@...radead.org> wrote:
> >>
> >> I think we just want a driver-local check for those combinations
> >> where we know this hack actually works, which really just seems
> >> to be x86-64 with PAT. Something like the patch below, but maybe with
> >> even more strong warnings to not do something like this elsewhere:
> >
> > I agree that your patch seems like the right way to ensure that the WC
> > optimization hack is only used where we know it works.
> >
> > But my concern is that it seems likely that non-cache coherent
> > implementations are relying on this hack as well.
>
> I've been trying to tell you they can't rely on that, because the amdgpu
> driver doesn't use this functionality for fundamentals such as ring
> buffers used for feeding the hardware with commands. Instead, for those
> it relies on snooped PCIe transfers being coherent with the CPU caches.
>
I understand it does not use this functionality for the ring. Instead,
it uses the DMA API, no?
On non-cache coherent systems, that DMA API will allocate memory and
map it uncached for the CPU so that it is coherent with the non-cache
coherent device.
In any case, if non-cache coherent systems are unlikely to work, and
unsupported in case they do, I am fine with disabling this
optimization unconditionally for non-X86 architectures.
>
> >> -#elif defined(CONFIG_X86) && !defined(CONFIG_X86_PAT)
> >> - /* Don't try to enable write-combining when it can't work, or things
> >> - * may be slow
> >> - * See https://bugs.freedesktop.org/show_bug.cgi?id=88758
> >> - */
> >> -
> >> -#ifndef CONFIG_COMPILE_TEST
> >> -#warning Please enable CONFIG_MTRR and CONFIG_X86_PAT for better performance \
> >> - thanks to write-combining
> >> -#endif
> >> -
> >> - if (bo->flags & AMDGPU_GEM_CREATE_CPU_GTT_USWC)
> >> - DRM_INFO_ONCE("Please enable CONFIG_MTRR and CONFIG_X86_PAT for "
> >> - "better performance thanks to write-combining\n");
>
> FWIW, please don't drop these compile and build time warnings where we
> continue to take advantage of PAT.
>
>
> --
> Earthling Michel Dänzer | http://www.amd.com
> Libre software enthusiast | Mesa and X developer
Powered by blists - more mailing lists