Re: [PATCH 1/3] drm/amdgpu: add AMDGPU_GEM_CREATE_DISCARDABLE

2022-07-11 Thread Christian König
That would be redundant. GDS handling has always worked in the way that the storage is thrown away after an IB. My LRU patch set should have helped with GDS out of memory errors, but I'm not sure how far along we are with rebasing amd-staging-drm-next. Christian. Am 08.07.22 um 16:58 schrieb

Re: [PATCH 1/3] drm/amdgpu: add AMDGPU_GEM_CREATE_DISCARDABLE

2022-07-08 Thread Marek Olšák
Christian, should we set this flag for GDS too? Will it help with GDS OOM failures? Marek On Fri., May 13, 2022, 07:26 Christian König, < ckoenig.leichtzumer...@gmail.com> wrote: > Exactly that's what we can't do. > > See the kernel must always be able to move things to GTT or discard. So > when

Re: [PATCH 1/3] drm/amdgpu: add AMDGPU_GEM_CREATE_DISCARDABLE

2022-05-13 Thread Christian König
Exactly that's what we can't do. See the kernel must always be able to move things to GTT or discard. So when you want to guarantee that something is in VRAM you must at the same time say you can discard it if it can't. Christian. Am 13.05.22 um 10:43 schrieb Pierre-Eric Pelloux-Prayer: Hi

Re: [PATCH 1/3] drm/amdgpu: add AMDGPU_GEM_CREATE_DISCARDABLE

2022-05-13 Thread Christian König
Well the best placement is guaranteed as long as the application doesn't do any nonsense (e.g. trying to allocate a buffer larger than available VRAM). The VM_ALWAYS_VALID flag doesn't affect any of that handling. Regards, Christian. Am 13.05.22 um 00:17 schrieb Marek Olšák: Would it be bette

Re: [PATCH 1/3] drm/amdgpu: add AMDGPU_GEM_CREATE_DISCARDABLE

2022-05-12 Thread Marek Olšák
Would it be better to set the VM_ALWAYS_VALID flag to have a greater guarantee that the best placement will be chosen? See, the main feature is getting the best placement, not being discardable. The best placement is a hw design requirement due to using memory for uses that are expected to have pe

Re: [PATCH 1/3] drm/amdgpu: add AMDGPU_GEM_CREATE_DISCARDABLE

2022-05-12 Thread Christian König
Am 12.05.22 um 00:06 schrieb Marek Olšák: 3rd question: Is it worth using this on APUs? It makes memory management somewhat easier when we are really OOM. E.g. it should also work for GTT allocations and when the core kernel says "Hey please free something up or I will start the OOM-killer" i

Re: [PATCH 1/3] drm/amdgpu: add AMDGPU_GEM_CREATE_DISCARDABLE

2022-05-11 Thread Marek Olšák
3rd question: Is it worth using this on APUs? Thanks, Marek On Wed, May 11, 2022 at 5:58 PM Marek Olšák wrote: > Will the kernel keep all discardable buffers in VRAM if VRAM is not > overcommitted by discardable buffers, or will other buffers also affect the > placement of discardable buffers?

Re: [PATCH 1/3] drm/amdgpu: add AMDGPU_GEM_CREATE_DISCARDABLE

2022-05-11 Thread Marek Olšák
Will the kernel keep all discardable buffers in VRAM if VRAM is not overcommitted by discardable buffers, or will other buffers also affect the placement of discardable buffers? Do evictions deallocate the buffer, or do they keep an allocation in GTT and only the copy is skipped? Thanks, Marek O

Re: [PATCH 1/3] drm/amdgpu: add AMDGPU_GEM_CREATE_DISCARDABLE

2022-05-11 Thread Marek Olšák
OK that sounds good. Marek On Wed, May 11, 2022 at 2:04 AM Christian König < ckoenig.leichtzumer...@gmail.com> wrote: > Hi Marek, > > Am 10.05.22 um 22:43 schrieb Marek Olšák: > > A better flag name would be: > AMDGPU_GEM_CREATE_BEST_PLACEMENT_OR_DISCARD > > > A bit long for my taste and I think

Re: [PATCH 1/3] drm/amdgpu: add AMDGPU_GEM_CREATE_DISCARDABLE

2022-05-10 Thread Christian König
Hi Marek, Am 10.05.22 um 22:43 schrieb Marek Olšák: A better flag name would be: AMDGPU_GEM_CREATE_BEST_PLACEMENT_OR_DISCARD A bit long for my taste and I think the best placement is just a side effect. Marek On Tue, May 10, 2022 at 4:13 PM Marek Olšák wrote: Does this really guara

Re: [PATCH 1/3] drm/amdgpu: add AMDGPU_GEM_CREATE_DISCARDABLE

2022-05-10 Thread Marek Olšák
A better flag name would be: AMDGPU_GEM_CREATE_BEST_PLACEMENT_OR_DISCARD Marek On Tue, May 10, 2022 at 4:13 PM Marek Olšák wrote: > Does this really guarantee VRAM placement? The code doesn't say anything > about that. > > Marek > > > On Fri, May 6, 2022 at 7:23 AM Christian König < > ckoenig.l

Re: [PATCH 1/3] drm/amdgpu: add AMDGPU_GEM_CREATE_DISCARDABLE

2022-05-10 Thread Marek Olšák
Does this really guarantee VRAM placement? The code doesn't say anything about that. Marek On Fri, May 6, 2022 at 7:23 AM Christian König < ckoenig.leichtzumer...@gmail.com> wrote: > Add a AMDGPU_GEM_CREATE_DISCARDABLE flag to note that the content of a BO > doesn't needs to be preserved during

Re: [PATCH 1/3] drm/amdgpu: add AMDGPU_GEM_CREATE_DISCARDABLE

2022-05-06 Thread Felix Kuehling
Am 2022-05-06 um 07:23 schrieb Christian König: Add a AMDGPU_GEM_CREATE_DISCARDABLE flag to note that the content of a BO doesn't needs to be preserved during eviction. KFD was already using a similar functionality for SVM BOs so replace the internal flag with the new UAPI. Only compile teste

[PATCH 1/3] drm/amdgpu: add AMDGPU_GEM_CREATE_DISCARDABLE

2022-05-06 Thread Christian König
Add a AMDGPU_GEM_CREATE_DISCARDABLE flag to note that the content of a BO doesn't needs to be preserved during eviction. KFD was already using a similar functionality for SVM BOs so replace the internal flag with the new UAPI. Only compile tested! Signed-off-by: Christian König --- drivers/gpu