diff mbox series

drm/buddy: Fix the range bias clear memory allocation issue

Message ID 20240508065720.125846-1-Arunpravin.PaneerSelvam@amd.com (mailing list archive)
State New, archived
Headers show
Series drm/buddy: Fix the range bias clear memory allocation issue | expand

Commit Message

Paneer Selvam, Arunpravin May 8, 2024, 6:57 a.m. UTC
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(-)

Comments

Daniel Vetter May 8, 2024, 8:41 a.m. UTC | #1
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
>
Paneer Selvam, Arunpravin May 12, 2024, 8:03 a.m. UTC | #2
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
>>
diff mbox series

Patch

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);