All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/buddy: Fix the range bias clear memory allocation issue
@ 2024-05-06 13:38 Arunpravin Paneer Selvam
  2024-05-07  8:35 ` Matthew Auld
  0 siblings, 1 reply; 5+ messages in thread
From: Arunpravin Paneer Selvam @ 2024-05-06 13:38 UTC (permalink / raw
  To: dri-devel, amd-gfx, matthew.auld
  Cc: christian.koenig, alexander.deucher, Arunpravin Paneer Selvam

Problem statement: During the system boot time, an application request
for the bulk volume of cleared range bias memory when the clear_avail
is zero, we dont fallback into normal allocation method as we had an
unnecessary clear_avail check which prevents the fallback method leads
to fb allocation failure following system goes into unresponsive state.

Solution: Remove the unnecessary clear_avail check in the range bias
allocation function.

Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Fixes: 96950929eb23 ("drm/buddy: Implement tracking clear page feature")
---
 drivers/gpu/drm/drm_buddy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_buddy.c b/drivers/gpu/drm/drm_buddy.c
index 284ebae71cc4..831929ac95eb 100644
--- a/drivers/gpu/drm/drm_buddy.c
+++ b/drivers/gpu/drm/drm_buddy.c
@@ -574,7 +574,7 @@ __drm_buddy_alloc_range_bias(struct drm_buddy *mm,
 
 	block = __alloc_range_bias(mm, start, end, order,
 				   flags, fallback);
-	if (IS_ERR(block) && mm->clear_avail)
+	if (IS_ERR(block))
 		return __alloc_range_bias(mm, start, end, order,
 					  flags, !fallback);
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm/buddy: Fix the range bias clear memory allocation issue
  2024-05-06 13:38 [PATCH] drm/buddy: Fix the range bias clear memory allocation issue Arunpravin Paneer Selvam
@ 2024-05-07  8:35 ` Matthew Auld
  0 siblings, 0 replies; 5+ messages in thread
From: Matthew Auld @ 2024-05-07  8:35 UTC (permalink / raw
  To: Arunpravin Paneer Selvam, dri-devel, amd-gfx
  Cc: christian.koenig, alexander.deucher

On 06/05/2024 14:38, Arunpravin Paneer Selvam wrote:
> Problem statement: During the system boot time, an application request
> for the bulk volume of cleared range bias memory when the clear_avail
> is zero, we dont fallback into normal allocation method as we had an
> unnecessary clear_avail check which prevents the fallback method leads
> to fb allocation failure following system goes into unresponsive state.
> 
> Solution: Remove the unnecessary clear_avail check in the range bias
> allocation function.
> 
> Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
> Fixes: 96950929eb23 ("drm/buddy: Implement tracking clear page feature")
Reviewed-by: Matthew Auld <matthew.auld@intel.com>



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] drm/buddy: Fix the range bias clear memory allocation issue
@ 2024-05-08  6:57 Arunpravin Paneer Selvam
  2024-05-08  8:41 ` Daniel Vetter
  0 siblings, 1 reply; 5+ messages in thread
From: Arunpravin Paneer Selvam @ 2024-05-08  6:57 UTC (permalink / raw
  To: dri-devel, amd-gfx, matthew.auld
  Cc: christian.koenig, alexander.deucher, Arunpravin Paneer Selvam

Problem statement: During the system boot time, an application request
for the bulk volume of cleared range bias memory when the clear_avail
is zero, we dont fallback into normal allocation method as we had an
unnecessary clear_avail check which prevents the fallback method leads
to fb allocation failure following system goes into unresponsive state.

Solution: Remove the unnecessary clear_avail check in the range bias
allocation function.

Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Fixes: 96950929eb23 ("drm/buddy: Implement tracking clear page feature")
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
---
 drivers/gpu/drm/drm_buddy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_buddy.c b/drivers/gpu/drm/drm_buddy.c
index 284ebae71cc4..831929ac95eb 100644
--- a/drivers/gpu/drm/drm_buddy.c
+++ b/drivers/gpu/drm/drm_buddy.c
@@ -574,7 +574,7 @@ __drm_buddy_alloc_range_bias(struct drm_buddy *mm,
 
 	block = __alloc_range_bias(mm, start, end, order,
 				   flags, fallback);
-	if (IS_ERR(block) && mm->clear_avail)
+	if (IS_ERR(block))
 		return __alloc_range_bias(mm, start, end, order,
 					  flags, !fallback);
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm/buddy: Fix the range bias clear memory allocation issue
  2024-05-08  6:57 Arunpravin Paneer Selvam
@ 2024-05-08  8:41 ` Daniel Vetter
  2024-05-12  8:03   ` Paneer Selvam, Arunpravin
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Vetter @ 2024-05-08  8:41 UTC (permalink / raw
  To: Arunpravin Paneer Selvam
  Cc: dri-devel, amd-gfx, matthew.auld, christian.koenig,
	alexander.deucher

On Wed, May 08, 2024 at 12:27:20PM +0530, Arunpravin Paneer Selvam wrote:
> Problem statement: During the system boot time, an application request
> for the bulk volume of cleared range bias memory when the clear_avail
> is zero, we dont fallback into normal allocation method as we had an
> unnecessary clear_avail check which prevents the fallback method leads
> to fb allocation failure following system goes into unresponsive state.
> 
> Solution: Remove the unnecessary clear_avail check in the range bias
> allocation function.
> 
> Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
> Fixes: 96950929eb23 ("drm/buddy: Implement tracking clear page feature")
> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
> ---
>  drivers/gpu/drm/drm_buddy.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Can you please also add a kunit test case to exercise this corner case and
make sure it stays fixed?

Thanks, Sima
> 
> diff --git a/drivers/gpu/drm/drm_buddy.c b/drivers/gpu/drm/drm_buddy.c
> index 284ebae71cc4..831929ac95eb 100644
> --- a/drivers/gpu/drm/drm_buddy.c
> +++ b/drivers/gpu/drm/drm_buddy.c
> @@ -574,7 +574,7 @@ __drm_buddy_alloc_range_bias(struct drm_buddy *mm,
>  
>  	block = __alloc_range_bias(mm, start, end, order,
>  				   flags, fallback);
> -	if (IS_ERR(block) && mm->clear_avail)
> +	if (IS_ERR(block))
>  		return __alloc_range_bias(mm, start, end, order,
>  					  flags, !fallback);
>  
> -- 
> 2.25.1
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm/buddy: Fix the range bias clear memory allocation issue
  2024-05-08  8:41 ` Daniel Vetter
@ 2024-05-12  8:03   ` Paneer Selvam, Arunpravin
  0 siblings, 0 replies; 5+ messages in thread
From: Paneer Selvam, Arunpravin @ 2024-05-12  8:03 UTC (permalink / raw
  To: Daniel Vetter
  Cc: dri-devel, amd-gfx, matthew.auld, christian.koenig,
	alexander.deucher

Hi Daniel,

On 5/8/2024 2:11 PM, Daniel Vetter wrote:
> On Wed, May 08, 2024 at 12:27:20PM +0530, Arunpravin Paneer Selvam wrote:
>> Problem statement: During the system boot time, an application request
>> for the bulk volume of cleared range bias memory when the clear_avail
>> is zero, we dont fallback into normal allocation method as we had an
>> unnecessary clear_avail check which prevents the fallback method leads
>> to fb allocation failure following system goes into unresponsive state.
>>
>> Solution: Remove the unnecessary clear_avail check in the range bias
>> allocation function.
>>
>> Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
>> Fixes: 96950929eb23 ("drm/buddy: Implement tracking clear page feature")
>> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
>> ---
>>   drivers/gpu/drm/drm_buddy.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
> Can you please also add a kunit test case to exercise this corner case and
> make sure it stays fixed?
I have sent the v2 along with a kunit test case for this corner case.

Thanks,
Arun.
>
> Thanks, Sima
>> diff --git a/drivers/gpu/drm/drm_buddy.c b/drivers/gpu/drm/drm_buddy.c
>> index 284ebae71cc4..831929ac95eb 100644
>> --- a/drivers/gpu/drm/drm_buddy.c
>> +++ b/drivers/gpu/drm/drm_buddy.c
>> @@ -574,7 +574,7 @@ __drm_buddy_alloc_range_bias(struct drm_buddy *mm,
>>   
>>   	block = __alloc_range_bias(mm, start, end, order,
>>   				   flags, fallback);
>> -	if (IS_ERR(block) && mm->clear_avail)
>> +	if (IS_ERR(block))
>>   		return __alloc_range_bias(mm, start, end, order,
>>   					  flags, !fallback);
>>   
>> -- 
>> 2.25.1
>>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-05-12  8:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-06 13:38 [PATCH] drm/buddy: Fix the range bias clear memory allocation issue Arunpravin Paneer Selvam
2024-05-07  8:35 ` Matthew Auld
  -- strict thread matches above, loose matches on Subject: below --
2024-05-08  6:57 Arunpravin Paneer Selvam
2024-05-08  8:41 ` Daniel Vetter
2024-05-12  8:03   ` Paneer Selvam, Arunpravin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.