RE: [PATCH] drm/amdgpu: Add uid info to process BO list

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

 



[AMD Public Use]

-----Original Message-----
From: Koenig, Christian <Christian.Koenig@xxxxxxx> 
Sent: Tuesday, September 22, 2020 12:15 PM
To: Chauhan, Madhav <Madhav.Chauhan@xxxxxxx>; amd-gfx@xxxxxxxxxxxxxxxxxxxxx
Cc: Surampalli, Kishore <Kishore.Surampalli@xxxxxxx>; Patel, Mihir <Mihir.Patel@xxxxxxx>; Sharma, Shashank <Shashank.Sharma@xxxxxxx>; Deucher, Alexander <Alexander.Deucher@xxxxxxx>; Saleem, Athar <Athar.Saleem@xxxxxxx>
Subject: Re: [PATCH] drm/amdgpu: Add uid info to process BO list

Am 21.09.20 um 21:55 schrieb Chauhan, Madhav:
> [AMD Public Use]
>
> -----Original Message-----
> From: Christian König <ckoenig.leichtzumerken@xxxxxxxxx>
> Sent: Tuesday, September 22, 2020 12:54 AM
> To: Chauhan, Madhav <Madhav.Chauhan@xxxxxxx>; 
> amd-gfx@xxxxxxxxxxxxxxxxxxxxx
> Cc: Surampalli, Kishore <Kishore.Surampalli@xxxxxxx>; Patel, Mihir 
> <Mihir.Patel@xxxxxxx>; Sharma, Shashank <Shashank.Sharma@xxxxxxx>; 
> Deucher, Alexander <Alexander.Deucher@xxxxxxx>; Saleem, Athar 
> <Athar.Saleem@xxxxxxx>
> Subject: Re: [PATCH] drm/amdgpu: Add uid info to process BO list
>
> Am 21.09.20 um 21:18 schrieb Madhav Chauhan:
>> UID is helpful while doing analysis of BO allocated by a process.
> Looks like a bit overkill to me, why not get the uid from the process info?
>
> Not sure if I got your point , but used the similar method implemented 
> at drm level inside drm_debugfs.c. Thanks

Good argument, but I'm not sure if we should duplicate that here. What do you need this for?

Thanks, We need details of BOs allocated by a process and associated UID so that we can do memory perf analysis using some scripts
To find the top consumer of GPU memory and see if those application can be optimized. 

Clients information at DRM level doesn’t print list of BO per process and since that is handled by amdgpu driver specific
Functions.  So all the BO list information at one place is really useful and needed by our customers as various other vendors
Already provide this.

Regards,
Madhav

Christian.

>
> Regards,
> Madhav
>
> Christian.
>
>> Signed-off-by: Madhav Chauhan <madhav.chauhan@xxxxxxx>
>> ---
>>    drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 6 +++++-
>>    1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
>> index f4c2e2e75b8f..c1982349ec7b 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
>> @@ -892,6 +892,7 @@ static int amdgpu_debugfs_gem_info(struct seq_file *m, void *data)
>>    	struct drm_info_node *node = (struct drm_info_node *)m->private;
>>    	struct drm_device *dev = node->minor->dev;
>>    	struct drm_file *file;
>> +	kuid_t uid;
>>    	int r;
>>    
>>    	r = mutex_lock_interruptible(&dev->filelist_mutex);
>> @@ -909,7 +910,10 @@ static int amdgpu_debugfs_gem_info(struct seq_file *m, void *data)
>>    		 */
>>    		rcu_read_lock();
>>    		task = pid_task(file->pid, PIDTYPE_PID);
>> -		seq_printf(m, "pid %8d command %s:\n", pid_nr(file->pid),
>> +		uid = task ? __task_cred(task)->euid : GLOBAL_ROOT_UID;
>> +		seq_printf(m, "pid %8d uid %5d command %s:\n",
>> +			   pid_nr(file->pid),
>> +			   from_kuid_munged(seq_user_ns(m), uid),
>>    			   task ? task->comm : "<unknown>");
>>    		rcu_read_unlock();
>>    
_______________________________________________
amd-gfx mailing list
amd-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/amd-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux