All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] drm/buddy: Fix the warn on's during force merge
@ 2024-05-17 13:50 Arunpravin Paneer Selvam
  2024-05-17 13:53 ` Paneer Selvam, Arunpravin
  2024-05-17 14:00 ` Matthew Auld
  0 siblings, 2 replies; 6+ messages in thread
From: Arunpravin Paneer Selvam @ 2024-05-17 13:50 UTC (permalink / raw)
  To: dri-devel, amd-gfx, matthew.auld
  Cc: christian.koenig, alexander.deucher, airlied,
	Arunpravin Paneer Selvam

Move the fallback and block incompatible checks
above, so that we dont unnecessarily split the blocks
and leaving the unmerged. This resolves the unnecessary
warn on's thrown during force_merge call.

v2:(Matthew)
  - Move the fallback and block incompatible checks above
    the contains check.

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 | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/drm_buddy.c b/drivers/gpu/drm/drm_buddy.c
index 1daf778cf6fa..94f8c34fc293 100644
--- a/drivers/gpu/drm/drm_buddy.c
+++ b/drivers/gpu/drm/drm_buddy.c
@@ -524,11 +524,11 @@ __alloc_range_bias(struct drm_buddy *mm,
 				continue;
 		}
 
+		if (!fallback && block_incompatible(block, flags))
+			continue;
+
 		if (contains(start, end, block_start, block_end) &&
 		    order == drm_buddy_block_order(block)) {
-			if (!fallback && block_incompatible(block, flags))
-				continue;
-
 			/*
 			 * Find the free block within the range.
 			 */
-- 
2.25.1


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

* Re: [PATCH v2] drm/buddy: Fix the warn on's during force merge
  2024-05-17 13:50 [PATCH v2] drm/buddy: Fix the warn on's during force merge Arunpravin Paneer Selvam
@ 2024-05-17 13:53 ` Paneer Selvam, Arunpravin
  2024-05-17 14:00 ` Matthew Auld
  1 sibling, 0 replies; 6+ messages in thread
From: Paneer Selvam, Arunpravin @ 2024-05-17 13:53 UTC (permalink / raw)
  To: dri-devel, amd-gfx, matthew.auld
  Cc: christian.koenig, alexander.deucher, airlied

Hi Matthew,
This fixes the problem.

Regards,
Arun.

On 5/17/2024 7:20 PM, Arunpravin Paneer Selvam wrote:
> Move the fallback and block incompatible checks
> above, so that we dont unnecessarily split the blocks
> and leaving the unmerged. This resolves the unnecessary
> warn on's thrown during force_merge call.
>
> v2:(Matthew)
>    - Move the fallback and block incompatible checks above
>      the contains check.
>
> 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 | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_buddy.c b/drivers/gpu/drm/drm_buddy.c
> index 1daf778cf6fa..94f8c34fc293 100644
> --- a/drivers/gpu/drm/drm_buddy.c
> +++ b/drivers/gpu/drm/drm_buddy.c
> @@ -524,11 +524,11 @@ __alloc_range_bias(struct drm_buddy *mm,
>   				continue;
>   		}
>   
> +		if (!fallback && block_incompatible(block, flags))
> +			continue;
> +
>   		if (contains(start, end, block_start, block_end) &&
>   		    order == drm_buddy_block_order(block)) {
> -			if (!fallback && block_incompatible(block, flags))
> -				continue;
> -
>   			/*
>   			 * Find the free block within the range.
>   			 */


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

* Re: [PATCH v2] drm/buddy: Fix the warn on's during force merge
  2024-05-17 13:50 [PATCH v2] drm/buddy: Fix the warn on's during force merge Arunpravin Paneer Selvam
  2024-05-17 13:53 ` Paneer Selvam, Arunpravin
@ 2024-05-17 14:00 ` Matthew Auld
  2024-05-17 14:34   ` Paneer Selvam, Arunpravin
  1 sibling, 1 reply; 6+ messages in thread
From: Matthew Auld @ 2024-05-17 14:00 UTC (permalink / raw)
  To: Arunpravin Paneer Selvam, dri-devel, amd-gfx
  Cc: christian.koenig, alexander.deucher, airlied

On 17/05/2024 14:50, Arunpravin Paneer Selvam wrote:
> Move the fallback and block incompatible checks
> above, so that we dont unnecessarily split the blocks
> and leaving the unmerged. This resolves the unnecessary
> warn on's thrown during force_merge call.
> 
> v2:(Matthew)
>    - Move the fallback and block incompatible checks above
>      the contains check.
> 
> 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>

A follow up unit test to catch this edge case would be lovely.

> ---
>   drivers/gpu/drm/drm_buddy.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_buddy.c b/drivers/gpu/drm/drm_buddy.c
> index 1daf778cf6fa..94f8c34fc293 100644
> --- a/drivers/gpu/drm/drm_buddy.c
> +++ b/drivers/gpu/drm/drm_buddy.c
> @@ -524,11 +524,11 @@ __alloc_range_bias(struct drm_buddy *mm,
>   				continue;
>   		}
>   
> +		if (!fallback && block_incompatible(block, flags))
> +			continue;
> +
>   		if (contains(start, end, block_start, block_end) &&
>   		    order == drm_buddy_block_order(block)) {
> -			if (!fallback && block_incompatible(block, flags))
> -				continue;
> -
>   			/*
>   			 * Find the free block within the range.
>   			 */

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

* [PATCH v2] drm/buddy: Fix the warn on's during force merge
@ 2024-05-17 14:33 Arunpravin Paneer Selvam
  2024-05-17 16:44 ` Paneer Selvam, Arunpravin
  0 siblings, 1 reply; 6+ messages in thread
From: Arunpravin Paneer Selvam @ 2024-05-17 14:33 UTC (permalink / raw)
  To: dri-devel, amd-gfx, matthew.auld
  Cc: christian.koenig, alexander.deucher, airlied,
	Arunpravin Paneer Selvam

Move the fallback and block incompatible checks
above, so that we dont unnecessarily split the blocks
and leaving the unmerged. This resolves the unnecessary
warn on's thrown during force_merge call.

v2:(Matthew)
  - Move the fallback and block incompatible checks above
    the contains check.

Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Fixes: 96950929eb23 ("drm/buddy: Implement tracking clear page feature")
Link: https://patchwork.kernel.org/project/dri-devel/patch/20240517135015.17565-1-Arunpravin.PaneerSelvam@amd.com/
---
 drivers/gpu/drm/drm_buddy.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/drm_buddy.c b/drivers/gpu/drm/drm_buddy.c
index 1daf778cf6fa..94f8c34fc293 100644
--- a/drivers/gpu/drm/drm_buddy.c
+++ b/drivers/gpu/drm/drm_buddy.c
@@ -524,11 +524,11 @@ __alloc_range_bias(struct drm_buddy *mm,
 				continue;
 		}
 
+		if (!fallback && block_incompatible(block, flags))
+			continue;
+
 		if (contains(start, end, block_start, block_end) &&
 		    order == drm_buddy_block_order(block)) {
-			if (!fallback && block_incompatible(block, flags))
-				continue;
-
 			/*
 			 * Find the free block within the range.
 			 */
-- 
2.25.1


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

* Re: [PATCH v2] drm/buddy: Fix the warn on's during force merge
  2024-05-17 14:00 ` Matthew Auld
@ 2024-05-17 14:34   ` Paneer Selvam, Arunpravin
  0 siblings, 0 replies; 6+ messages in thread
From: Paneer Selvam, Arunpravin @ 2024-05-17 14:34 UTC (permalink / raw)
  To: Matthew Auld, dri-devel, amd-gfx
  Cc: christian.koenig, alexander.deucher, airlied



On 5/17/2024 7:30 PM, Matthew Auld wrote:
> On 17/05/2024 14:50, Arunpravin Paneer Selvam wrote:
>> Move the fallback and block incompatible checks
>> above, so that we dont unnecessarily split the blocks
>> and leaving the unmerged. This resolves the unnecessary
>> warn on's thrown during force_merge call.
>>
>> v2:(Matthew)
>>    - Move the fallback and block incompatible checks above
>>      the contains check.
>>
>> 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>
>
> A follow up unit test to catch this edge case would be lovely.
Yes, I will follow up on this.

Thanks,
Arun.
>
>> ---
>>   drivers/gpu/drm/drm_buddy.c | 6 +++---
>>   1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/drm_buddy.c b/drivers/gpu/drm/drm_buddy.c
>> index 1daf778cf6fa..94f8c34fc293 100644
>> --- a/drivers/gpu/drm/drm_buddy.c
>> +++ b/drivers/gpu/drm/drm_buddy.c
>> @@ -524,11 +524,11 @@ __alloc_range_bias(struct drm_buddy *mm,
>>                   continue;
>>           }
>>   +        if (!fallback && block_incompatible(block, flags))
>> +            continue;
>> +
>>           if (contains(start, end, block_start, block_end) &&
>>               order == drm_buddy_block_order(block)) {
>> -            if (!fallback && block_incompatible(block, flags))
>> -                continue;
>> -
>>               /*
>>                * Find the free block within the range.
>>                */


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

* Re: [PATCH v2] drm/buddy: Fix the warn on's during force merge
  2024-05-17 14:33 Arunpravin Paneer Selvam
@ 2024-05-17 16:44 ` Paneer Selvam, Arunpravin
  0 siblings, 0 replies; 6+ messages in thread
From: Paneer Selvam, Arunpravin @ 2024-05-17 16:44 UTC (permalink / raw)
  To: dri-devel, amd-gfx, matthew.auld, Dave Airlie
  Cc: christian.koenig, alexander.deucher, airlied

Hi Dave,
Please help pull this patch into drm-next. This will fix any unnecessary
warnings in memory pressure situation.

Thanks for the help.

Regards,
Arun.

On 5/17/2024 8:03 PM, Arunpravin Paneer Selvam wrote:
> Move the fallback and block incompatible checks
> above, so that we dont unnecessarily split the blocks
> and leaving the unmerged. This resolves the unnecessary
> warn on's thrown during force_merge call.
>
> v2:(Matthew)
>    - Move the fallback and block incompatible checks above
>      the contains check.
>
> Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
> Fixes: 96950929eb23 ("drm/buddy: Implement tracking clear page feature")
> Link: https://patchwork.kernel.org/project/dri-devel/patch/20240517135015.17565-1-Arunpravin.PaneerSelvam@amd.com/
> ---
>   drivers/gpu/drm/drm_buddy.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_buddy.c b/drivers/gpu/drm/drm_buddy.c
> index 1daf778cf6fa..94f8c34fc293 100644
> --- a/drivers/gpu/drm/drm_buddy.c
> +++ b/drivers/gpu/drm/drm_buddy.c
> @@ -524,11 +524,11 @@ __alloc_range_bias(struct drm_buddy *mm,
>   				continue;
>   		}
>   
> +		if (!fallback && block_incompatible(block, flags))
> +			continue;
> +
>   		if (contains(start, end, block_start, block_end) &&
>   		    order == drm_buddy_block_order(block)) {
> -			if (!fallback && block_incompatible(block, flags))
> -				continue;
> -
>   			/*
>   			 * Find the free block within the range.
>   			 */


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

end of thread, other threads:[~2024-05-17 16:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-17 13:50 [PATCH v2] drm/buddy: Fix the warn on's during force merge Arunpravin Paneer Selvam
2024-05-17 13:53 ` Paneer Selvam, Arunpravin
2024-05-17 14:00 ` Matthew Auld
2024-05-17 14:34   ` Paneer Selvam, Arunpravin
  -- strict thread matches above, loose matches on Subject: below --
2024-05-17 14:33 Arunpravin Paneer Selvam
2024-05-17 16:44 ` 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.