[PATCH v2 3/4] drm/amdkfd: Increase SMI event fifo size

James Zhu jamesz at amd.com
Thu Aug 22 14:34:17 UTC 2024


On 2024-07-30 16:15, Philip Yang wrote:
> SMI event fifo size 1KB was enough to report GPU vm fault or reset
[JZ] There is a typo here. it should be NOT enough.
> event, increase it to 8KB to store about 100 migrate events, less chance
> to drop the migrate events if lots of migration happened in the short
> period of time. Add KFD prefix to the macro name.
>
> Signed-off-by: Philip Yang <Philip.Yang at amd.com>
> ---
>   drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c b/drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c
> index 1d94b445a060..9b8169761ec5 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c
> @@ -44,7 +44,7 @@ struct kfd_smi_client {
>   	bool suser;
>   };
>   
> -#define MAX_KFIFO_SIZE	1024
> +#define KFD_MAX_KFIFO_SIZE	8192
>   
>   static __poll_t kfd_smi_ev_poll(struct file *, struct poll_table_struct *);
>   static ssize_t kfd_smi_ev_read(struct file *, char __user *, size_t, loff_t *);
> @@ -86,7 +86,7 @@ static ssize_t kfd_smi_ev_read(struct file *filep, char __user *user,
>   	struct kfd_smi_client *client = filep->private_data;
>   	unsigned char *buf;
>   
> -	size = min_t(size_t, size, MAX_KFIFO_SIZE);
> +	size = min_t(size_t, size, KFD_MAX_KFIFO_SIZE);
>   	buf = kmalloc(size, GFP_KERNEL);
>   	if (!buf)
>   		return -ENOMEM;
> @@ -355,7 +355,7 @@ int kfd_smi_event_open(struct kfd_node *dev, uint32_t *fd)
>   		return -ENOMEM;
>   	INIT_LIST_HEAD(&client->list);
>   
> -	ret = kfifo_alloc(&client->fifo, MAX_KFIFO_SIZE, GFP_KERNEL);
> +	ret = kfifo_alloc(&client->fifo, KFD_MAX_KFIFO_SIZE, GFP_KERNEL);
>   	if (ret) {
>   		kfree(client);
>   		return ret;


More information about the amd-gfx mailing list