Bug 110481

Summary: performance hot issues in amdgpu_cs_ib_vm_chunk
Product: DRI Reporter: baopeng <baopeng88_com>
Component: DRM/AMDgpuAssignee: Default DRI bug account <dri-devel>
Status: RESOLVED MOVED QA Contact:
Severity: normal    
Priority: medium    
Version: DRI git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description baopeng 2019-04-22 02:50:57 UTC
We have encountered performance hot issues in vce module. Cpu occupancy rate has been in the alloc_vmap_area function.
We found that calling the alloc_vmap_area function mainly occurs in the amdgpu_cs_ib_vm_chunk function. So we removed the main loop judgment logic of amdgpu_cs_ib_vm_chunk.
as follows .
-	if (p->ring->funcs->parse_cs || p->ring->funcs->patch_cs_in_place) {
+       if (0)
If we don't delete, vce will be very slow.

Is this the fundamental way to solve the problem? Or there are other ways to solve the problem?

3q very much.
Comment 1 baopeng 2019-04-22 03:48:43 UTC
performance hot stack:

start_thread ->
impl_thrd_routine ->
util_queue_thread_func ->				
amdgpu_cs_submit_ib	->
amdgpu_cs_submit_raw ->					
drmCommandWriteRead ->
ioctl ->
el0_svc ->
el0_svc_handler ->
el0_svc_common ->
__arm64_sys_ioctl ->
ksys_ioctl ->
do_vfs_ioctl ->		
amdgpu_drm_ioctl ->
drm_ioctl ->
drm_ioctl_kernel ->
amdgpu_cs_ioctl ->
amdgpu_bo_kmap->
ttm_bo_kmap ->
vmap ->
__get_vm_area_node ->		
alloc_vmap_area
Comment 2 Christian König 2019-04-23 13:03:56 UTC
(In reply to baopeng from comment #0)
> -	if (p->ring->funcs->parse_cs || p->ring->funcs->patch_cs_in_place) {
> +       if (0)
> If we don't delete, vce will be very slow.
> 
> Is this the fundamental way to solve the problem?

Well certainly not, this code is important for VCE handle management.

> Or there are other ways to solve the problem?

Well what problem do you have? VCE usually uses less than 100 submissions per second, so that you run into any performance bottleneck here is rather unlikely.
Comment 3 Martin Peres 2019-11-19 09:19:43 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/drm/amd/issues/756.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.