Re: [PATCH] drm/ttm: make sure pool pages are cleared

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Feb 10, 2021 at 09:23:52PM +0100, Christian König wrote:
> 
> 
> Am 10.02.21 um 19:15 schrieb Daniel Vetter:
> > On Wed, Feb 10, 2021 at 5:05 PM Christian König
> > <ckoenig.leichtzumerken@xxxxxxxxx> wrote:
> > > The old implementation wasn't consistend on this.
> > > 
> > > But it looks like we depend on this so better bring it back.
> > > 
> > > Signed-off-by: Christian König <christian.koenig@xxxxxxx>
> > > Reported-and-tested-by: Mike Galbraith <efault@xxxxxx>
> > > Fixes: d099fc8f540a ("drm/ttm: new TT backend allocation pool v3")
> > Well I think in general there's a bit an issue in ttm with not
> > clearing stuff everywhere. So definitely in favour of clearing stuff.
> > Looking at the code this only fixes the clearing, at alloc time we're
> > still very optional with clearing. I think we should just set
> > __GFP_ZERO unconditionally there too.
> 
> No, the alloc handling is actually correct.
> 
> We are clearing only when we allocate pages for userspace. Not for the
> kernel nor for eviction when pages are overwritten anyway.
> 
> The key point is that the old page pool was ignoring the flag for this in
> some code paths and I wasn't sure if that's still necessary or not.
> 
> Turned out it was necessary after all.

Somehow my git grep went wrong and I didn't find the users. You're right,
and I learned a few things more :-)

I'm kinda wondering, should we perhaps move the clearing to the use side,
and then only do when required? Might allow us to save it quite a few
times when we're thrashing around buffers in/out of vram, at the cost of
moving it to the alloc side for other cases.

Just an idea.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux