2023-04-26 15:24:21

by Andrzej Hajda

[permalink] [raw]
Subject: [PATCH v7 0/2] drm/i915: Hugepage manager and test for MTL

This patchset patches sent by Jonathan and Andi, with
addressed CI failures:
1. Fixed checking alignment of 64K pages on both Pre-Gen12 and Gen12.
2. Fixed start alignment of 2M pages.

Regards
Andrzej

Jonathan Cavitt (2):
drm/i915: Migrate platform-dependent mock hugepage selftests to live
drm/i915: Use correct huge page manager for MTL

.../gpu/drm/i915/gem/selftests/huge_pages.c | 88 +++++++++++++++----
drivers/gpu/drm/i915/gt/gen8_ppgtt.c | 3 +-
2 files changed, 71 insertions(+), 20 deletions(-)

Cc: [email protected]
Cc: [email protected]
Cc: Jonathan Cavitt <[email protected]>
Cc: Andrzej Hajda <[email protected]>
Cc: Matthew Auld <[email protected]>
--
2.39.2

---
Jonathan Cavitt (2):
drm/i915: Migrate platform-dependent mock hugepage selftests to live
drm/i915: Use correct huge page manager for MTL

drivers/gpu/drm/i915/gem/selftests/huge_pages.c | 105 ++++++++++++++++++------
drivers/gpu/drm/i915/gt/gen8_ppgtt.c | 3 +-
2 files changed, 82 insertions(+), 26 deletions(-)
---
base-commit: 4d0066a1c0763d50b6fb017e27d12b081ce21b57
change-id: 20230425-hugepage-migrate-1869aaf31a6d

Best regards,
--
Andrzej Hajda <[email protected]>


2023-04-26 15:25:15

by Andrzej Hajda

[permalink] [raw]
Subject: [PATCH v7 2/2] drm/i915: Use correct huge page manager for MTL

From: Jonathan Cavitt <[email protected]>

MTL currently uses gen8_ppgtt_insert_huge when managing huge pages. This is because
MTL reports as not supporting 64K pages, or more accurately, the system that reports
whether a platform has 64K pages reports false for MTL. This is only half correct,
as the 64K page support reporting system only cares about 64K page support for LMEM,
which MTL doesn't have.

MTL should be using xehpsdv_ppgtt_insert_huge. However, simply changing over to
using that manager doesn't resolve the issue because MTL is expecting the virtual
address space for the page table to be flushed after initialization, so we must also
add a flush statement there.

Signed-off-by: Jonathan Cavitt <[email protected]>
Reviewed-by: Matthew Auld <[email protected]>
Signed-off-by: Andrzej Hajda <[email protected]>
---
drivers/gpu/drm/i915/gt/gen8_ppgtt.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gt/gen8_ppgtt.c b/drivers/gpu/drm/i915/gt/gen8_ppgtt.c
index 4daaa6f5566888..9c571185395f49 100644
--- a/drivers/gpu/drm/i915/gt/gen8_ppgtt.c
+++ b/drivers/gpu/drm/i915/gt/gen8_ppgtt.c
@@ -570,6 +570,7 @@ xehpsdv_ppgtt_insert_huge(struct i915_address_space *vm,
}
} while (rem >= page_size && index < max);

+ drm_clflush_virt_range(vaddr, PAGE_SIZE);
vma_res->page_sizes_gtt |= page_size;
} while (iter->sg && sg_dma_len(iter->sg));
}
@@ -707,7 +708,7 @@ static void gen8_ppgtt_insert(struct i915_address_space *vm,
struct sgt_dma iter = sgt_dma(vma_res);

if (vma_res->bi.page_sizes.sg > I915_GTT_PAGE_SIZE) {
- if (HAS_64K_PAGES(vm->i915))
+ if (GRAPHICS_VER_FULL(vm->i915) >= IP_VER(12, 50))
xehpsdv_ppgtt_insert_huge(vm, vma_res, &iter, cache_level, flags);
else
gen8_ppgtt_insert_huge(vm, vma_res, &iter, cache_level, flags);

--
2.34.1

2023-04-26 15:37:34

by Cavitt, Jonathan

[permalink] [raw]
Subject: RE: [PATCH v7 0/2] drm/i915: Hugepage manager and test for MTL

-----Original Message-----
From: Hajda, Andrzej <[email protected]>
Sent: Wednesday, April 26, 2023 8:14 AM
To: [email protected]; [email protected]; Cavitt, Jonathan <[email protected]>; Hajda, Andrzej <[email protected]>; Auld, Matthew <[email protected]>
Subject: [PATCH v7 0/2] drm/i915: Hugepage manager and test for MTL
>
>This patchset patches sent by Jonathan and Andi, with
>addressed CI failures:
>1. Fixed checking alignment of 64K pages on both Pre-Gen12 and Gen12.
>2. Fixed start alignment of 2M pages.
>
>Regards
>Andrzej
>
>Jonathan Cavitt (2):
> drm/i915: Migrate platform-dependent mock hugepage selftests to live
> drm/i915: Use correct huge page manager for MTL
>
>.../gpu/drm/i915/gem/selftests/huge_pages.c | 88 +++++++++++++++----
> drivers/gpu/drm/i915/gt/gen8_ppgtt.c | 3 +-
> 2 files changed, 71 insertions(+), 20 deletions(-)
>
>Cc: [email protected]
>Cc: [email protected]
>Cc: Jonathan Cavitt <[email protected]>
>Cc: Andrzej Hajda <[email protected]>
>Cc: Matthew Auld <[email protected]>
>--
>2.39.2
>
>---
>Jonathan Cavitt (2):
> drm/i915: Migrate platform-dependent mock hugepage selftests to live
> drm/i915: Use correct huge page manager for MTL
>
> drivers/gpu/drm/i915/gem/selftests/huge_pages.c | 105 ++++++++++++++++++------
> drivers/gpu/drm/i915/gt/gen8_ppgtt.c | 3 +-
> 2 files changed, 82 insertions(+), 26 deletions(-)
>---
>base-commit: 4d0066a1c0763d50b6fb017e27d12b081ce21b57
>change-id: 20230425-hugepage-migrate-1869aaf31a6d
>
>Best regards,
>--
>Andrzej Hajda <[email protected]>


Just reviewed the changes proper. It's been a while, so I don't remember everything
about the prior version, but I think I recognized what was changed:

- I wasn't aware a 21 bit alignment was required for 2M page sizes. I'm glad you caught that.
- The extra debugging/error information will be helpful in the case of a failure.
- Grabbing the per-context VM instead of the ppgtt vm sounds good to me.

Everything here looks amenable.
Acked-by: Jonathan Cavitt <[email protected]>
Though, given I'm also one of the signed-off-bys, I don't know if me acking it is exactly above-board.
-Jonathan Cavitt


>

2023-04-26 21:46:45

by Andrzej Hajda

[permalink] [raw]
Subject: Re: [PATCH v7 0/2] drm/i915: Hugepage manager and test for MTL



On 26.04.2023 17:31, Cavitt, Jonathan wrote:
> -----Original Message-----
> From: Hajda, Andrzej <[email protected]>
> Sent: Wednesday, April 26, 2023 8:14 AM
> To: [email protected]; [email protected]; Cavitt, Jonathan <[email protected]>; Hajda, Andrzej <[email protected]>; Auld, Matthew <[email protected]>
> Subject: [PATCH v7 0/2] drm/i915: Hugepage manager and test for MTL
>> This patchset patches sent by Jonathan and Andi, with
>> addressed CI failures:
>> 1. Fixed checking alignment of 64K pages on both Pre-Gen12 and Gen12.
>> 2. Fixed start alignment of 2M pages.
>>
>> Regards
>> Andrzej
>>
>> Jonathan Cavitt (2):
>> drm/i915: Migrate platform-dependent mock hugepage selftests to live
>> drm/i915: Use correct huge page manager for MTL
>>
>> .../gpu/drm/i915/gem/selftests/huge_pages.c | 88 +++++++++++++++----
>> drivers/gpu/drm/i915/gt/gen8_ppgtt.c | 3 +-
>> 2 files changed, 71 insertions(+), 20 deletions(-)
>>
>> Cc: [email protected]
>> Cc: [email protected]
>> Cc: Jonathan Cavitt <[email protected]>
>> Cc: Andrzej Hajda <[email protected]>
>> Cc: Matthew Auld <[email protected]>
>> --
>> 2.39.2
>>
>> ---
>> Jonathan Cavitt (2):
>> drm/i915: Migrate platform-dependent mock hugepage selftests to live
>> drm/i915: Use correct huge page manager for MTL
>>
>> drivers/gpu/drm/i915/gem/selftests/huge_pages.c | 105 ++++++++++++++++++------
>> drivers/gpu/drm/i915/gt/gen8_ppgtt.c | 3 +-
>> 2 files changed, 82 insertions(+), 26 deletions(-)
>> ---
>> base-commit: 4d0066a1c0763d50b6fb017e27d12b081ce21b57
>> change-id: 20230425-hugepage-migrate-1869aaf31a6d
>>
>> Best regards,
>> --
>> Andrzej Hajda <[email protected]>
>
> Just reviewed the changes proper. It's been a while, so I don't remember everything
> about the prior version, but I think I recognized what was changed:
>
> - I wasn't aware a 21 bit alignment was required for 2M page sizes. I'm glad you caught that.
> - The extra debugging/error information will be helpful in the case of a failure.
> - Grabbing the per-context VM instead of the ppgtt vm sounds good to me.
>
> Everything here looks amenable.
> Acked-by: Jonathan Cavitt <[email protected]>
> Though, given I'm also one of the signed-off-bys, I don't know if me acking it is exactly above-board.
> -Jonathan Cavitt

Thanks for looking at it. CI spotted another issue: 2M pages are
preferred over old-64K, if former are available.
Fixed version sent.
Regarding tags, I've kept your authorship, s-o-b, and added my
Co-developed, if it is OK to you I will keep it this way.
If you prefer otherwise let me know.

Regards
Andrzej

>

2023-04-26 21:50:59

by Cavitt, Jonathan

[permalink] [raw]
Subject: RE: [PATCH v7 0/2] drm/i915: Hugepage manager and test for MTL

-----Original Message-----
From: Hajda, Andrzej <[email protected]>
Sent: Wednesday, April 26, 2023 2:37 PM
To: Cavitt, Jonathan <[email protected]>; [email protected]; [email protected]; Auld, Matthew <[email protected]>
Subject: Re: [PATCH v7 0/2] drm/i915: Hugepage manager and test for MTL
>
>On 26.04.2023 17:31, Cavitt, Jonathan wrote:
>> -----Original Message-----
>> From: Hajda, Andrzej <[email protected]>
>> Sent: Wednesday, April 26, 2023 8:14 AM
>> To: [email protected]; [email protected]; Cavitt, Jonathan <[email protected]>; Hajda, Andrzej <[email protected]>; Auld, Matthew <[email protected]>
>> Subject: [PATCH v7 0/2] drm/i915: Hugepage manager and test for MTL
>>> This patchset patches sent by Jonathan and Andi, with
>>> addressed CI failures:
>>> 1. Fixed checking alignment of 64K pages on both Pre-Gen12 and Gen12.
>>> 2. Fixed start alignment of 2M pages.
>>>
>>> Regards
>>> Andrzej
>>>
>>> Jonathan Cavitt (2):
>>> drm/i915: Migrate platform-dependent mock hugepage selftests to live
>>> drm/i915: Use correct huge page manager for MTL
>>>
>>> .../gpu/drm/i915/gem/selftests/huge_pages.c | 88 +++++++++++++++----
>>> drivers/gpu/drm/i915/gt/gen8_ppgtt.c | 3 +-
>>> 2 files changed, 71 insertions(+), 20 deletions(-)
>>>
>>> Cc: [email protected]
>>> Cc: [email protected]
>>> Cc: Jonathan Cavitt <[email protected]>
>>> Cc: Andrzej Hajda <[email protected]>
>>> Cc: Matthew Auld <[email protected]>
>>> --
>>> 2.39.2
>>>
>>> ---
>>> Jonathan Cavitt (2):
>>> drm/i915: Migrate platform-dependent mock hugepage selftests to live
>>> drm/i915: Use correct huge page manager for MTL
>>>
>>> drivers/gpu/drm/i915/gem/selftests/huge_pages.c | 105 ++++++++++++++++++------
>>> drivers/gpu/drm/i915/gt/gen8_ppgtt.c | 3 +-
>>> 2 files changed, 82 insertions(+), 26 deletions(-)
>>> ---
>>> base-commit: 4d0066a1c0763d50b6fb017e27d12b081ce21b57
>>> change-id: 20230425-hugepage-migrate-1869aaf31a6d
>>>
>>> Best regards,
>>> --
>>> Andrzej Hajda <[email protected]>
>>
>> Just reviewed the changes proper. It's been a while, so I don't remember everything
>> about the prior version, but I think I recognized what was changed:
>>
>> - I wasn't aware a 21 bit alignment was required for 2M page sizes. I'm glad you caught that.
>> - The extra debugging/error information will be helpful in the case of a failure.
>> - Grabbing the per-context VM instead of the ppgtt vm sounds good to me.
>>
>> Everything here looks amenable.
>> Acked-by: Jonathan Cavitt <[email protected]>
>> Though, given I'm also one of the signed-off-bys, I don't know if me acking it is exactly above-board.
>> -Jonathan Cavitt
>
>Thanks for looking at it. CI spotted another issue: 2M pages are
>preferred over old-64K, if former are available.
>Fixed version sent.
>Regarding tags, I've kept your authorship, s-o-b, and added my
>Co-developed, if it is OK to you I will keep it this way.
>If you prefer otherwise let me know.

That is entirely acceptable! Thank you for your time.
-Jonathan Cavitt

>
>Regards
>Andrzej
>
>>
>
>