Re: [PATCH 1/2] [WIP]drm/ttm: add waiter list to prevent allocation not in order

2018-02-05 Thread Christian König
Am 05.02.2018 um 09:22 schrieb Chunming Zhou: On 2018年01月31日 18:54, Christian König wrote: So I think preventing validation on same place is a simpler way: process B bo's place is fpfn~lpfn, it will only try to evict LRU BOs in that range, while eviction, we just prevent those validation to

Re: [PATCH 1/2] [WIP]drm/ttm: add waiter list to prevent allocation not in order

2018-02-05 Thread Chunming Zhou
On 2018年01月31日 18:54, Christian König wrote: So I think preventing validation on same place is a simpler way: process B bo's place is fpfn~lpfn, it will only try to evict LRU BOs in that range, while eviction, we just prevent those validation to this range(fpfn~lpfn), if out of this range,

Re: [PATCH 1/2] [WIP]drm/ttm: add waiter list to prevent allocation not in order

2018-01-31 Thread Christian König
So I think preventing validation on same place is a simpler way: process B bo's place is fpfn~lpfn, it will only try to evict LRU BOs in that range, while eviction, we just prevent those validation to this range(fpfn~lpfn), if out of this range, the allocation/validation still can be go on.

Re: [PATCH 1/2] [WIP]drm/ttm: add waiter list to prevent allocation not in order

2018-01-31 Thread Chunming Zhou
On 2018年01月26日 22:35, Christian König wrote: I just realized that a change I'm thinking about for a while would solve your problem as well, but keep concurrent allocation possible. See ttm_mem_evict_first() unlocks the BO after evicting it:     ttm_bo_del_from_lru(bo);    

Re: [PATCH 1/2] [WIP]drm/ttm: add waiter list to prevent allocation not in order

2018-01-26 Thread Christian König
I just realized that a change I'm thinking about for a while would solve your problem as well, but keep concurrent allocation possible. See ttm_mem_evict_first() unlocks the BO after evicting it:     ttm_bo_del_from_lru(bo);     spin_unlock(>lru_lock);     ret = ttm_bo_evict(bo,

Re: [PATCH 1/2] [WIP]drm/ttm: add waiter list to prevent allocation not in order

2018-01-26 Thread Christian König
I know, but this has the same effect. You prevent concurrent allocation from happening. What we could do is to pipeline reusing of deleted memory as well, this makes it less likely to cause the problem you are seeing because the evicting processes doesn't need to block for deleted BOs any

Re: [PATCH 1/2] [WIP]drm/ttm: add waiter list to prevent allocation not in order

2018-01-26 Thread Zhou, David(ChunMing)
I don't want to prevent all, my new approach is to prevent the later allocation is trying and ahead of front to get the memory space that the front made from eviction. 发自坚果 Pro Christian K鰊ig 于 2018年1月26日 下午9:24写道: Yes, exactly that's the problem. See

Re: [PATCH 1/2] [WIP]drm/ttm: add waiter list to prevent allocation not in order

2018-01-26 Thread Christian König
Yes, exactly that's the problem. See when you want to prevent a process B from allocating the memory process A has evicted, you need to prevent all concurrent allocation. And we don't do that because it causes a major performance drop. Regards, Christian. Am 26.01.2018 um 14:21 schrieb

Re: [PATCH 1/2] [WIP]drm/ttm: add waiter list to prevent allocation not in order

2018-01-26 Thread Zhou, David(ChunMing)
You patch will prevent concurrent allocation, and will result in allocation performance drop much. 发自坚果 Pro Christian K鰊ig 于 2018年1月26日 下午9:04写道: Attached is what you actually want to do cleanly implemented. But as I said this is a NO-GO. Regards,

Re: [PATCH 1/2] [WIP]drm/ttm: add waiter list to prevent allocation not in order

2018-01-26 Thread Christian König
Attached is what you actually want to do cleanly implemented. But as I said this is a NO-GO. Regards, Christian. Am 26.01.2018 um 13:43 schrieb Christian König: After my investigation, this issue should be detect of TTM design self, which breaks scheduling balance. Yeah, but again. This is

Re: [PATCH 1/2] [WIP]drm/ttm: add waiter list to prevent allocation not in order

2018-01-26 Thread Christian König
After my investigation, this issue should be detect of TTM design self, which breaks scheduling balance. Yeah, but again. This is indented design we can't change easily. Regards, Christian. Am 26.01.2018 um 13:36 schrieb Zhou, David(ChunMing): I am off work, so reply mail by phone, the format

Re: [PATCH 1/2] [WIP]drm/ttm: add waiter list to prevent allocation not in order

2018-01-26 Thread Zhou, David(ChunMing)
I am off work, so reply mail by phone, the format could not be text. back to topic itself: the problem indeed happen on amdgpu driver, someone reports me that application runs with two instances, the performance are different. I also reproduced the issue with unit test(bo_eviction_test). They

Re: [PATCH 1/2] [WIP]drm/ttm: add waiter list to prevent allocation not in order

2018-01-26 Thread Christian König
Am 26.01.2018 um 11:22 schrieb Chunming Zhou: there is a scheduling balance issue about get node like: a. process A allocates full memory and use it for submission. b. process B tries to allocates memory, will wait for process A BO idle in eviction. c. process A completes the job, process B

[PATCH 1/2] [WIP]drm/ttm: add waiter list to prevent allocation not in order

2018-01-26 Thread Chunming Zhou
there is a scheduling balance issue about get node like: a. process A allocates full memory and use it for submission. b. process B tries to allocates memory, will wait for process A BO idle in eviction. c. process A completes the job, process B eviction will put process A BO node, but in the