diff mbox series

[1/2] drm/buddy: stop using PAGE_SIZE

Message ID 20240229105112.250077-3-matthew.auld@intel.com (mailing list archive)
State New, archived
Headers show
Series [1/2] drm/buddy: stop using PAGE_SIZE | expand

Commit Message

Matthew Auld Feb. 29, 2024, 10:51 a.m. UTC
The drm_buddy minimum page-size requirements should be distinct from the
CPU PAGE_SIZE. Only restriction is that the minimum page-size is at
least 4K.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Arnd Bergmann <arnd@arndb.de>
---
 drivers/gpu/drm/drm_buddy.c | 2 +-
 include/drm/drm_buddy.h     | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

Comments

Paneer Selvam, Arunpravin Feb. 29, 2024, 11:09 a.m. UTC | #1
Reviewed-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>

On 2/29/2024 4:21 PM, Matthew Auld wrote:
> The drm_buddy minimum page-size requirements should be distinct from the
> CPU PAGE_SIZE. Only restriction is that the minimum page-size is at
> least 4K.
>
> Signed-off-by: Matthew Auld<matthew.auld@intel.com>
> Cc: Arunpravin Paneer Selvam<Arunpravin.PaneerSelvam@amd.com>
> Cc: Christian König<christian.koenig@amd.com>
> Cc: Arnd Bergmann<arnd@arndb.de>
> ---
>   drivers/gpu/drm/drm_buddy.c | 2 +-
>   include/drm/drm_buddy.h     | 6 +++---
>   2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_buddy.c b/drivers/gpu/drm/drm_buddy.c
> index 5ebdd6f8f36e..f999568d69c1 100644
> --- a/drivers/gpu/drm/drm_buddy.c
> +++ b/drivers/gpu/drm/drm_buddy.c
> @@ -102,7 +102,7 @@ int drm_buddy_init(struct drm_buddy *mm, u64 size, u64 chunk_size)
>   	if (size < chunk_size)
>   		return -EINVAL;
>   
> -	if (chunk_size < PAGE_SIZE)
> +	if (chunk_size < SZ_4K)
>   		return -EINVAL;
>   
>   	if (!is_power_of_2(chunk_size))
> diff --git a/include/drm/drm_buddy.h b/include/drm/drm_buddy.h
> index a5b39fc01003..19ed661a32f3 100644
> --- a/include/drm/drm_buddy.h
> +++ b/include/drm/drm_buddy.h
> @@ -53,8 +53,8 @@ struct drm_buddy_block {
>   	struct list_head tmp_link;
>   };
>   
> -/* Order-zero must be at least PAGE_SIZE */
> -#define DRM_BUDDY_MAX_ORDER (63 - PAGE_SHIFT)
> +/* Order-zero must be at least SZ_4K */
> +#define DRM_BUDDY_MAX_ORDER (63 - 12)
>   
>   /*
>    * Binary Buddy System.
> @@ -82,7 +82,7 @@ struct drm_buddy {
>   	unsigned int n_roots;
>   	unsigned int max_order;
>   
> -	/* Must be at least PAGE_SIZE */
> +	/* Must be at least SZ_4K */
>   	u64 chunk_size;
>   	u64 size;
>   	u64 avail;
Christian König Feb. 29, 2024, 1:24 p.m. UTC | #2
Am 29.02.24 um 11:51 schrieb Matthew Auld:
> The drm_buddy minimum page-size requirements should be distinct from the
> CPU PAGE_SIZE. Only restriction is that the minimum page-size is at
> least 4K.
>
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> Cc: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
> Cc: Christian König <christian.koenig@amd.com>
> Cc: Arnd Bergmann <arnd@arndb.de>

Acked-by: Christian König <christian.koenig@amd.com> for the series.

> ---
>   drivers/gpu/drm/drm_buddy.c | 2 +-
>   include/drm/drm_buddy.h     | 6 +++---
>   2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_buddy.c b/drivers/gpu/drm/drm_buddy.c
> index 5ebdd6f8f36e..f999568d69c1 100644
> --- a/drivers/gpu/drm/drm_buddy.c
> +++ b/drivers/gpu/drm/drm_buddy.c
> @@ -102,7 +102,7 @@ int drm_buddy_init(struct drm_buddy *mm, u64 size, u64 chunk_size)
>   	if (size < chunk_size)
>   		return -EINVAL;
>   
> -	if (chunk_size < PAGE_SIZE)
> +	if (chunk_size < SZ_4K)
>   		return -EINVAL;
>   
>   	if (!is_power_of_2(chunk_size))
> diff --git a/include/drm/drm_buddy.h b/include/drm/drm_buddy.h
> index a5b39fc01003..19ed661a32f3 100644
> --- a/include/drm/drm_buddy.h
> +++ b/include/drm/drm_buddy.h
> @@ -53,8 +53,8 @@ struct drm_buddy_block {
>   	struct list_head tmp_link;
>   };
>   
> -/* Order-zero must be at least PAGE_SIZE */
> -#define DRM_BUDDY_MAX_ORDER (63 - PAGE_SHIFT)
> +/* Order-zero must be at least SZ_4K */
> +#define DRM_BUDDY_MAX_ORDER (63 - 12)
>   
>   /*
>    * Binary Buddy System.
> @@ -82,7 +82,7 @@ struct drm_buddy {
>   	unsigned int n_roots;
>   	unsigned int max_order;
>   
> -	/* Must be at least PAGE_SIZE */
> +	/* Must be at least SZ_4K */
>   	u64 chunk_size;
>   	u64 size;
>   	u64 avail;
Arnd Bergmann Feb. 29, 2024, 1:29 p.m. UTC | #3
On Thu, Feb 29, 2024, at 11:51, Matthew Auld wrote:
> The drm_buddy minimum page-size requirements should be distinct from the
> CPU PAGE_SIZE. Only restriction is that the minimum page-size is at
> least 4K.
>
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> Cc: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
> Cc: Christian König <christian.koenig@amd.com>
> Cc: Arnd Bergmann <arnd@arndb.de>

Acked-by: Arnd Bergmann <arnd@arndb.de>
Dave Airlie May 17, 2024, 1:11 a.m. UTC | #4
On Thu, 29 Feb 2024 at 23:48, Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Thu, Feb 29, 2024, at 11:51, Matthew Auld wrote:
> > The drm_buddy minimum page-size requirements should be distinct from the
> > CPU PAGE_SIZE. Only restriction is that the minimum page-size is at
> > least 4K.
> >
> > Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> > Cc: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
> > Cc: Christian König <christian.koenig@amd.com>
> > Cc: Arnd Bergmann <arnd@arndb.de>
>
> Acked-by: Arnd Bergmann <arnd@arndb.de>

Has this landed anywhere yet?

I'm been testing 6.9 on 64K pages and the buddy tests are exploding so
I wanted to pull this in.

Dave.
Matthew Auld May 17, 2024, 8:53 a.m. UTC | #5
On 17/05/2024 02:11, Dave Airlie wrote:
> On Thu, 29 Feb 2024 at 23:48, Arnd Bergmann <arnd@arndb.de> wrote:
>>
>> On Thu, Feb 29, 2024, at 11:51, Matthew Auld wrote:
>>> The drm_buddy minimum page-size requirements should be distinct from the
>>> CPU PAGE_SIZE. Only restriction is that the minimum page-size is at
>>> least 4K.
>>>
>>> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
>>> Cc: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
>>> Cc: Christian König <christian.koenig@amd.com>
>>> Cc: Arnd Bergmann <arnd@arndb.de>
>>
>> Acked-by: Arnd Bergmann <arnd@arndb.de>
> 
> Has this landed anywhere yet?

Looks like it fell through the cracks. I think it still applies, so just 
needs someone with commit rights to push it.

> 
> I'm been testing 6.9 on 64K pages and the buddy tests are exploding so
> I wanted to pull this in.
> 
> Dave.
Christian König May 17, 2024, 11 a.m. UTC | #6
Am 17.05.24 um 10:53 schrieb Matthew Auld:
> On 17/05/2024 02:11, Dave Airlie wrote:
>> On Thu, 29 Feb 2024 at 23:48, Arnd Bergmann <arnd@arndb.de> wrote:
>>>
>>> On Thu, Feb 29, 2024, at 11:51, Matthew Auld wrote:
>>>> The drm_buddy minimum page-size requirements should be distinct 
>>>> from the
>>>> CPU PAGE_SIZE. Only restriction is that the minimum page-size is at
>>>> least 4K.
>>>>
>>>> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
>>>> Cc: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
>>>> Cc: Christian König <christian.koenig@amd.com>
>>>> Cc: Arnd Bergmann <arnd@arndb.de>
>>>
>>> Acked-by: Arnd Bergmann <arnd@arndb.de>
>>
>> Has this landed anywhere yet?
>
> Looks like it fell through the cracks. I think it still applies, so 
> just needs someone with commit rights to push it.

Pushed to drm-misc-fixes.

Regards,
Christian.

>
>>
>> I'm been testing 6.9 on 64K pages and the buddy tests are exploding so
>> I wanted to pull this in.
>>
>> Dave.
Matthew Auld May 17, 2024, 11:17 a.m. UTC | #7
On 17/05/2024 12:00, Christian König wrote:
> Am 17.05.24 um 10:53 schrieb Matthew Auld:
>> On 17/05/2024 02:11, Dave Airlie wrote:
>>> On Thu, 29 Feb 2024 at 23:48, Arnd Bergmann <arnd@arndb.de> wrote:
>>>>
>>>> On Thu, Feb 29, 2024, at 11:51, Matthew Auld wrote:
>>>>> The drm_buddy minimum page-size requirements should be distinct 
>>>>> from the
>>>>> CPU PAGE_SIZE. Only restriction is that the minimum page-size is at
>>>>> least 4K.
>>>>>
>>>>> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
>>>>> Cc: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
>>>>> Cc: Christian König <christian.koenig@amd.com>
>>>>> Cc: Arnd Bergmann <arnd@arndb.de>
>>>>
>>>> Acked-by: Arnd Bergmann <arnd@arndb.de>
>>>
>>> Has this landed anywhere yet?
>>
>> Looks like it fell through the cracks. I think it still applies, so 
>> just needs someone with commit rights to push it.
> 
> Pushed to drm-misc-fixes.

Thanks.

> 
> Regards,
> Christian.
> 
>>
>>>
>>> I'm been testing 6.9 on 64K pages and the buddy tests are exploding so
>>> I wanted to pull this in.
>>>
>>> Dave.
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_buddy.c b/drivers/gpu/drm/drm_buddy.c
index 5ebdd6f8f36e..f999568d69c1 100644
--- a/drivers/gpu/drm/drm_buddy.c
+++ b/drivers/gpu/drm/drm_buddy.c
@@ -102,7 +102,7 @@  int drm_buddy_init(struct drm_buddy *mm, u64 size, u64 chunk_size)
 	if (size < chunk_size)
 		return -EINVAL;
 
-	if (chunk_size < PAGE_SIZE)
+	if (chunk_size < SZ_4K)
 		return -EINVAL;
 
 	if (!is_power_of_2(chunk_size))
diff --git a/include/drm/drm_buddy.h b/include/drm/drm_buddy.h
index a5b39fc01003..19ed661a32f3 100644
--- a/include/drm/drm_buddy.h
+++ b/include/drm/drm_buddy.h
@@ -53,8 +53,8 @@  struct drm_buddy_block {
 	struct list_head tmp_link;
 };
 
-/* Order-zero must be at least PAGE_SIZE */
-#define DRM_BUDDY_MAX_ORDER (63 - PAGE_SHIFT)
+/* Order-zero must be at least SZ_4K */
+#define DRM_BUDDY_MAX_ORDER (63 - 12)
 
 /*
  * Binary Buddy System.
@@ -82,7 +82,7 @@  struct drm_buddy {
 	unsigned int n_roots;
 	unsigned int max_order;
 
-	/* Must be at least PAGE_SIZE */
+	/* Must be at least SZ_4K */
 	u64 chunk_size;
 	u64 size;
 	u64 avail;