Re: [PATCH 1/2] drm/ttm: fix out-of-bounds read in ttm_put_pages() v2

2019-04-09 Thread Zhang, Jerry(Junwei)
On 4/8/19 9:13 PM, Christian König wrote: When ttm_put_pages() tries to figure out whether it's dealing with transparent hugepages, it just reads past the bounds of the pages array without a check. v2: simplify the test if enough pages are left in the array (Christian). Series is Reviewed-by: J

Re: [RFC PATCH] drm/ttm: force cached mappings for system RAM on ARM

2019-01-10 Thread Zhang, Jerry(Junwei)
On 1/10/19 3:28 PM, Ard Biesheuvel wrote: ARM systems do not permit the use of anything other than cached mappings for system memory, since that memory may be mapped in the linear region as well, and the architecture does not permit aliases with mismatched attributes. So short-circuit the evalua

Re: [PATCH 2/2] drm/ttm: Use pr_debug for all output from ttm_bo_evict

2018-12-06 Thread Zhang, Jerry(Junwei)
On 12/6/18 5:33 PM, Koenig, Christian wrote: Am 06.12.18 um 10:09 schrieb Michel Dänzer: On 2018-12-06 3:43 a.m., Zhang, Jerry(Junwei) wrote: On 12/6/18 12:56 AM, Michel Dänzer wrote: From: Michel Dänzer All the output is related, so it should all be printed the same way. Some of it was

Re: [PATCH 2/2] drm/ttm: Use pr_debug for all output from ttm_bo_evict

2018-12-05 Thread Zhang, Jerry(Junwei)
On 12/6/18 12:56 AM, Michel Dänzer wrote: From: Michel Dänzer All the output is related, so it should all be printed the same way. Some of it was using pr_debug, but some of it appeared in dmesg by default. The caller should handle failure, so there's no need to spam dmesg with potentially quit

Re: [PATCH 1/2] drm: Only #define DEBUG if CONFIG_DYNAMIC_DEBUG is disabled

2018-12-05 Thread Zhang, Jerry(Junwei)
On 12/6/18 12:56 AM, Michel Dänzer wrote: From: Michel Dänzer The following cases are possible for pr_debug(): 1. CONFIG_DYNAMIC_DEBUG disabled a) DEBUG not defined: pr_debug() translates to no_printk(...), i.e. it never generates any output. b) DEBUG defined: pr_debug() transla

Re: [PATCH] drm/amd/amdgpu/vce_v3_0.c: Remove duplicate header

2018-11-21 Thread Zhang, Jerry(Junwei)
On 11/21/18 3:11 PM, Brajeswar Ghosh wrote: Remove gca/gfx_8_0_d.h which is included more than once Signed-off-by: Brajeswar Ghosh Reviewed-by: Junwei Zhang --- drivers/gpu/drm/amd/amdgpu/vce_v3_0.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c

Re: [PATCH -next] drm/ttm: remove set but not used variable 'driver'

2018-11-07 Thread Zhang, Jerry(Junwei)
On 11/8/18 10:15 AM, YueHaibing wrote: Fixes gcc '-Wunused-but-set-variable' warning: drivers/gpu/drm/ttm/ttm_execbuf_util.c: In function 'ttm_eu_fence_buffer_objects': drivers/gpu/drm/ttm/ttm_execbuf_util.c:190:24: warning: variable 'driver' set but not used [-Wunused-but-set-variable] It n

Re: [PATCH 6/8] drm/amdgpu: always reserve two slots for the VM

2018-10-23 Thread Zhang, Jerry(Junwei)
On 10/4/18 9:12 PM, Christian König wrote: And drop the now superflous extra reservations. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 15 ++- 2 files changed, 6 insertions(+), 13 deletions(-) dif

Re: [PATCH 1/8] dma-buf: remove shared fence staging in reservation object

2018-10-23 Thread Zhang, Jerry(Junwei)
Patch 3, 5 is Acked-by: Junwei Zhang Others are Reviewed-by: Junwei Zhang On 10/4/18 9:12 PM, Christian König wrote: No need for that any more. Just replace the list when there isn't enough room any more for the additional fence. Signed-off-by: Christian König --- drivers/dma-buf/reservat

Re: [PATCH 4/5] drm/ttm: initialize globals during device init

2018-10-22 Thread Zhang, Jerry(Junwei)
On 10/22/2018 08:35 PM, Christian König wrote: Am 22.10.18 um 08:45 schrieb Zhang, Jerry(Junwei): A question in ttm_bo.c [SNIP]     int ttm_bo_device_release(struct ttm_bo_device *bdev)   { @@ -1623,18 +1620,25 @@ int ttm_bo_device_release(struct ttm_bo_device *bdev

Re: [PATCH 4/5] drm/ttm: initialize globals during device init

2018-10-21 Thread Zhang, Jerry(Junwei)
A question for ttm_bo.c On 10/20/2018 12:41 AM, Christian König wrote: Make sure that the global BO state is always correctly initialized. This allows removing all the device code to initialize it. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 59 +

Re: [PATCH 1/5] drm/ttm: use a static ttm_mem_global instance

2018-10-21 Thread Zhang, Jerry(Junwei)
On 10/20/2018 12:41 AM, Christian König wrote: As the name says we only need one global instance of ttm_mem_global. Drop all the driver initialization and just use a single exported instance which is initialized during BO global initialization. Signed-off-by: Christian König Patch 1, 2, 3, 5

Re: [PATCH 4/5] drm/ttm: initialize globals during device init

2018-10-21 Thread Zhang, Jerry(Junwei)
A question in ttm_bo.c On 10/20/2018 12:41 AM, Christian König wrote: Make sure that the global BO state is always correctly initialized. This allows removing all the device code to initialize it. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 59 +-

Re: [PATCH 2/3] drm/amdgpu: Replace TTM initialization/release with ttm_global

2018-10-18 Thread Zhang, Jerry(Junwei)
On 10/19/2018 12:27 AM, Thomas Zimmermann wrote: Unified initialization and relesae of the global TTM state is provided by struct ttm_global and its interfaces. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 63 ++--- drivers/gpu/drm/amd/am

Re: [PATCH] list: introduce list_bulk_move_tail helper

2018-09-17 Thread Zhang, Jerry(Junwei)
On 09/17/2018 08:08 PM, Christian König wrote: Move all entries between @first and including @last before @head. This is useful for LRU lists where a whole block of entries should be moved to the end of the list. Used as a band aid in TTM, but better placed in the common list headers. Signed-o

Re: [PATCH] list: introduce list_bulk_move_tail helper

2018-09-17 Thread Zhang, Jerry(Junwei)
On 09/17/2018 08:08 PM, Christian König wrote: Move all entries between @first and including @last before @head. This is useful for LRU lists where a whole block of entries should be moved to the end of the list. Used as a band aid in TTM, but better placed in the common list headers. Signed-o

Re: [PATCH v6 4/5] drm/amdgpu: use bulk moves for efficient VM LRU handling (v6)

2018-08-22 Thread Zhang, Jerry (Junwei)
On 08/22/2018 06:12 PM, Huang Rui wrote: I continue to work for bulk moving that based on the proposal by Christian. Background: amdgpu driver will move all PD/PT and PerVM BOs into idle list. Then move all of them on the end of LRU list one by one. Thus, that cause so many BOs moved to the end

Re: [PATCH v5 4/5] drm/amdgpu: use bulk moves for efficient VM LRU handling (v5)

2018-08-22 Thread Zhang, Jerry (Junwei)
On 08/22/2018 04:33 PM, Huang Rui wrote: On Wed, Aug 22, 2018 at 04:07:20PM +0800, Zhang, Jerry wrote: On 08/22/2018 03:52 PM, Huang Rui wrote: I continue to work for bulk moving that based on the proposal by Christian. Background: amdgpu driver will move all PD/PT and PerVM BOs into idle list

Re: [PATCH v5 4/5] drm/amdgpu: use bulk moves for efficient VM LRU handling (v5)

2018-08-22 Thread Zhang, Jerry (Junwei)
On 08/22/2018 04:38 PM, Huang Rui wrote: On Wed, Aug 22, 2018 at 04:33:30PM +0800, Huang Rui wrote: On Wed, Aug 22, 2018 at 04:07:20PM +0800, Zhang, Jerry wrote: On 08/22/2018 03:52 PM, Huang Rui wrote: I continue to work for bulk moving that based on the proposal by Christian. Background: am

Re: [PATCH v5 4/5] drm/amdgpu: use bulk moves for efficient VM LRU handling (v5)

2018-08-22 Thread Zhang, Jerry (Junwei)
On 08/22/2018 03:52 PM, Huang Rui wrote: I continue to work for bulk moving that based on the proposal by Christian. Background: amdgpu driver will move all PD/PT and PerVM BOs into idle list. Then move all of them on the end of LRU list one by one. Thus, that cause so many BOs moved to the end

Re: [PATCH v3 4/5] drm/amdgpu: use bulk moves for efficient VM LRU handling (v3)

2018-08-13 Thread Zhang, Jerry (Junwei)
On 08/13/2018 05:58 PM, Huang Rui wrote: I continue to work for bulk moving that based on the proposal by Christian. Background: amdgpu driver will move all PD/PT and PerVM BOs into idle list. Then move all of them on the end of LRU list one by one. Thus, that cause so many BOs moved to the end

Re: [PATCH v3 1/5] drm/ttm: add helper structures for bulk moves on lru list

2018-08-13 Thread Zhang, Jerry (Junwei)
On 08/13/2018 06:16 PM, Christian König wrote: Am 13.08.2018 um 11:58 schrieb Huang Rui: From: Christian König Add bulk move pos to store the pointer of first and last buffer object. The list in between will be bulk moved on lru list. Signed-off-by: Christian König Signed-off-by: Huang Rui

Re: [PATCH 2/3] drm/scheduler: add counter for total jobs in scheduler

2018-08-01 Thread Zhang, Jerry (Junwei)
On 08/02/2018 02:08 PM, Nayan Deshmukh wrote: On Thu, Aug 2, 2018 at 11:29 AM Zhang, Jerry (Junwei) mailto:jerry.zh...@amd.com>> wrote: On 08/02/2018 01:50 PM, Nayan Deshmukh wrote: > > > On Thu, Aug 2, 2018 at 10:31 AM Zhang, Jerry (Junwei) mailto:jerr

Re: [PATCH 2/3] drm/scheduler: add counter for total jobs in scheduler

2018-08-01 Thread Zhang, Jerry (Junwei)
On 08/02/2018 01:50 PM, Nayan Deshmukh wrote: On Thu, Aug 2, 2018 at 10:31 AM Zhang, Jerry (Junwei) mailto:jerry.zh...@amd.com>> wrote: On 07/12/2018 02:36 PM, Nayan Deshmukh wrote: > Signed-off-by: Nayan Deshmukh mailto:nayan26deshm...@gmail.com>> > --- &

Re: [PATCH 2/3] drm/scheduler: add counter for total jobs in scheduler

2018-08-01 Thread Zhang, Jerry (Junwei)
On 07/12/2018 02:36 PM, Nayan Deshmukh wrote: Signed-off-by: Nayan Deshmukh --- drivers/gpu/drm/scheduler/gpu_scheduler.c | 3 +++ include/drm/gpu_scheduler.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/drivers/gpu/drm/scheduler/gpu_scheduler.c b/drivers/gpu/drm/sch

Re: [PATCH] drm/ttm: Merge hugepage attr changes in ttm_dma_page_put.

2018-07-25 Thread Zhang, Jerry (Junwei)
On 07/26/2018 04:29 AM, Bas Nieuwenhuizen wrote: Every set_pages_array_wb call resulted in cross-core interrupts and TLB flushes. Merge more of them for less overhead. This reduces the time needed to free a 1.6 GiB GTT WC buffer as part of Vulkan CTS from ~2 sec to < 0.25 sec. (Allocation still

Re: [PATCH 3/4] drm/amdgpu: add independent DMA-buf export v3

2018-06-28 Thread Zhang, Jerry (Junwei)
On 06/22/2018 10:11 PM, Christian König wrote: The caching of SGT's done by the DRM code is actually quite harmful and should probably removed altogether in the long term. Start by providing a separate DMA-buf export implementation in amdgpu. This is also a prerequisite of unpinned DMA-buf handl

Re: [PATCH 2/4] dma-buf: lock the reservation object during (un)map_dma_buf v2

2018-06-28 Thread Zhang, Jerry (Junwei)
On 06/22/2018 10:11 PM, Christian König wrote: First step towards unpinned DMA buf operation. I've checked the DRM drivers to potential locking of the reservation object, but essentially we need to audit all implementations of the dma_buf _ops for this to work. v2: reordered Signed-off-by: Chr

Re: [PATCH 1/4] dma-buf: add dma_buf_(un)map_attachment_locked variants v2

2018-06-28 Thread Zhang, Jerry (Junwei)
On 06/22/2018 10:11 PM, Christian König wrote: Add function variants which can be called with the reservation lock already held. v2: reordered, add lockdep asserts, fix kerneldoc Signed-off-by: Christian König --- drivers/dma-buf/dma-buf.c | 57 +++

Re: [PATCH 1/4] dma-buf: add dma_buf_(un)map_attachment_locked variants v2

2018-06-28 Thread Zhang, Jerry (Junwei)
On 06/22/2018 10:11 PM, Christian König wrote: Add function variants which can be called with the reservation lock already held. v2: reordered, add lockdep asserts, fix kerneldoc Signed-off-by: Christian König --- drivers/dma-buf/dma-buf.c | 57 +++

Re: [PATCH 00/13] *** per vm lru ***

2018-05-13 Thread Zhang, Jerry (Junwei)
On 05/10/2018 04:45 PM, zhoucm1 wrote: On 2018年05月10日 13:07, Zhang, Jerry (Junwei) wrote: On 05/09/2018 02:45 PM, Chunming Zhou wrote: move implemenation from ttm to amdgpu driver. (suggested by Christian) per-vm-lru is because of per-vm-bo, which has no chance to refresh lru, the nagtive

Re: [PATCH 00/13] *** per vm lru ***

2018-05-13 Thread Zhang, Jerry (Junwei)
On 05/10/2018 04:45 PM, zhoucm1 wrote: On 2018年05月10日 13:07, Zhang, Jerry (Junwei) wrote: On 05/09/2018 02:45 PM, Chunming Zhou wrote: move implemenation from ttm to amdgpu driver. (suggested by Christian) per-vm-lru is because of per-vm-bo, which has no chance to refresh lru, the nagtive

Re: [PATCH] drm/ttm: specify bo priority when initializing ttm bo

2018-05-10 Thread Zhang, Jerry (Junwei)
On 05/11/2018 10:26 AM, zhoucm1 wrote: On 2018年05月11日 10:19, Zhang, Jerry (Junwei) wrote: On 05/11/2018 10:11 AM, zhoucm1 wrote: On 2018年05月11日 09:21, Zhang, Jerry (Junwei) wrote: On 05/10/2018 10:40 PM, Christian König wrote: Am 10.05.2018 um 07:01 schrieb Junwei Zhang: Expect to add

Re: [PATCH] drm/ttm: specify bo priority when initializing ttm bo

2018-05-10 Thread Zhang, Jerry (Junwei)
On 05/11/2018 10:11 AM, zhoucm1 wrote: On 2018年05月11日 09:21, Zhang, Jerry (Junwei) wrote: On 05/10/2018 10:40 PM, Christian König wrote: Am 10.05.2018 um 07:01 schrieb Junwei Zhang: Expect to add an evitable bo who has reservation object to the correct lru[bo->priority] list Nice ca

Re: [PATCH] drm/ttm: specify bo priority when initializing ttm bo

2018-05-10 Thread Zhang, Jerry (Junwei)
On 05/10/2018 10:40 PM, Christian König wrote: Am 10.05.2018 um 07:01 schrieb Junwei Zhang: Expect to add an evitable bo who has reservation object to the correct lru[bo->priority] list Nice catch, but since this affects only a very small use case can we just remove and readd the BO to the LRU

Re: [PATCH 00/13] *** per vm lru ***

2018-05-09 Thread Zhang, Jerry (Junwei)
On 05/09/2018 02:45 PM, Chunming Zhou wrote: move implemenation from ttm to amdgpu driver. (suggested by Christian) per-vm-lru is because of per-vm-bo, which has no chance to refresh lru, the nagtive effect is game performance isn't stable. so all per-vm-bo should have a default order, every per