Skip to contentSkip to conversation

PPGTT dynamic page allocations

PATCH Superseded Michel Thierry 7 participants 229 messages Dec 18, 2014 – Mar 20, 2015 Page 4 of 4

Subsystems (2)
lore
Share & tools
lore
#224 lore raw

PATCH v6 32/32 drm/i915/bdw: Flip the 48b switch

In reply to Michel Thierry

Use 48b addresses if hw supports it and i915.enable_ppgtt=3.

Aliasing PPGTT remains 32b only.

---
 drivers/gpu/drm/i915/i915_gem_gtt.c | 7 ++-----
 drivers/gpu/drm/i915/i915_params.c  | 2 +-
 2 files changed, 3 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/i915_gem_gtt.c +2 -5
index 842ce93..fda5907 100644
@@ -107,7 +107,7 @@ static int sanitize_enable_ppgtt(struct drm_device *dev, int enable_ppgtt)
 
 #ifdef CONFIG_64BIT
 	has_full_64bit_ppgtt = IS_BROADWELL(dev) ||
-				INTEL_INFO(dev)->gen >= 9 && false; /* FIXME: 64b */
+				INTEL_INFO(dev)->gen >= 9;
 #else
 	has_full_64bit_ppgtt = false;
 #endif
@@ -1076,9 +1076,6 @@ static int gen8_ppgtt_alloc_page_directories(struct i915_address_space *vm,
 
 	BUG_ON(!bitmap_empty(new_pds, pdpes));
 
-	/* FIXME: PPGTT container_of won't work for 64b */
-	BUG_ON((start + length) > 0x800000000ULL);
-
 	gen8_for_each_pdpe(pd, pdp, start, length, temp, pdpe) {
 		if (pd)
 			continue;
@@ -1397,7 +1394,7 @@ static int gen8_aliasing_ppgtt_init(struct i915_hw_ppgtt *ppgtt)
 {
 	struct drm_device *dev = ppgtt->base.dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
-	struct i915_page_directory_pointer_entry *pdp = &ppgtt->pdp; /* FIXME: 48b */
+	struct i915_page_directory_pointer_entry *pdp = &ppgtt->pdp; /* FIXME: 48b? */
 	struct i915_page_directory_entry *pd;
 	uint64_t temp, start = 0, size = dev_priv->gtt.base.total;
 	uint32_t pdpe;
drivers/gpu/drm/i915/i915_params.c +1 -1
index 44f2262..1cd43b0 100644
@@ -119,7 +119,7 @@ MODULE_PARM_DESC(enable_hangcheck,
 module_param_named_unsafe(enable_ppgtt, i915.enable_ppgtt, int, 0400);
 MODULE_PARM_DESC(enable_ppgtt,
 	"Override PPGTT usage. "
-	"(-1=auto [default], 0=disabled, 1=aliasing, 2=full)");
+	"(-1=auto [default], 0=disabled, 1=aliasing, 2=full, 3=full_64b)");
 
 module_param_named(enable_execlists, i915.enable_execlists, int, 0400);
 MODULE_PARM_DESC(enable_execlists,
Signature · 6 lines
2.1.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#225 lore raw

Re: [PATCH v6 00/32] PPGTT dynamic page allocations and 48b addressing

In reply to Michel Thierry
Quoted 52 lines · Michel Thierry

This patchset addresses comments from v5 by Mika, specially some rename changes touched several patches.

For GEN8, it has also been extended to work in logical ring submission (lrc) mode, as it will be the preferred mode of operation.
I also tried to update the lrc code at the same time the ppgtt refactoring occurred, leaving only one patch that is exclusively for lrc.

I'm also now including the required patches for PPGTT with 48b addressing. In order expand the GPU address space, a 4th level translation is added, the Page Map Level 4 (PML4). This PML4 has 256 PML4 Entries (PML4E), PML4[0-255], each pointing to a PDP.

For now, this feature will only be available in BDW and GEN9, in LRC submission mode (execlists) and when i915.enable_ppgtt=3 is set.
Also note that this expanded address space is only available for full PPGTT, aliasing PPGTT remains 32b.

This list can be seen in 3 parts:
[01-10] Add page table allocation for GEN6/GEN7 [11-20] Enable dynamic allocation in GEN8,for both legacy and execlist submission modes.
[21-32] PML4 support in BDW and GEN9+.

Ben Widawsky (26):
drm/i915: page table abstractions
drm/i915: Complete page table structures
drm/i915: Create page table allocators
drm/i915: Track GEN6 page table usage
drm/i915: Extract context switch skip and pd load logic drm/i915: Track page table reload need
drm/i915: Initialize all contexts
drm/i915: Finish gen6/7 dynamic page table allocation drm/i915/bdw: Use dynamic allocation idioms on free drm/i915/bdw: page directories rework allocation drm/i915/bdw: pagetable allocation rework
drm/i915/bdw: Update pdp switch and point unused PDPs to scratch page drm/i915: num_pd_pages/num_pd_entries isn't useful drm/i915: Extract PPGTT param from page_directory alloc drm/i915/bdw: Split out mappings
drm/i915/bdw: begin bitmap tracking
drm/i915/bdw: Dynamic page table allocations
drm/i915/bdw: Make pdp allocation more dynamic drm/i915/bdw: Abstract PDP usage
drm/i915/bdw: Add dynamic page trace events
drm/i915/bdw: Add ppgtt info for dynamic pages drm/i915/bdw: implement alloc/free for 4lvl
drm/i915/bdw: Add 4 level switching infrastructure drm/i915/bdw: Generalize PTE writing for GEN8 PPGTT drm/i915: Plumb sg_iter through va allocation ->maps drm/i915: Expand error state's address width to 64b

Quoted 7 lines

Michel Thierry (6):
drm/i915: Plumb drm_device through page tables operations drm/i915: Add dynamic page trace events
drm/i915/bdw: Support dynamic pdp updates in lrc mode drm/i915/bdw: Support 64 bit PPGTT in lrc mode drm/i915/bdw: Add 4 level support in insert_entries and clear_range drm/i915/bdw: Flip the 48b switch

When just a few patches changed (which I suspect is the case here) please don't resend the entire series, but only resend the individual patches in-reply-to their earlier versions.

Resending the entire series too often tends to split up the discussions between multiple threads, so should be used cautiously. My approach is that I don't resend the entire series except when all the patches have changed. And I only resend when the review round has reached a conclusion. While the review is ongoing doing incremental updates of the series is imo much better.

But when resending the entire series, please start a new thread. Otherwise it again starts to become unclear which versions of which patches go together.

And a quick aside if you fear that a patch causes subsequent patches to no longer apply without a rebase: I can deal with a lot of small conflicts quickly when merging. And if that doesn't cut it I'll just ask for a resend when needed.

Just a quick reminder of patch resending bkms, intel-gfx is a really busy place so everyone needs to strive for best signal/noise ratio.

Thanks, Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#226 lore raw

Re: [PATCH v6 00/32] PPGTT dynamic page allocations and 48b addressing

Quoted 72 lines · Daniel Vetter
Quoted 52 lines · Michel Thierry

This patchset addresses comments from v5 by Mika, specially some rename changes touched several patches.

For GEN8, it has also been extended to work in logical ring submission (lrc) mode, as it will be the preferred mode of operation.
I also tried to update the lrc code at the same time the ppgtt refactoring occurred, leaving only one patch that is exclusively for lrc.

I'm also now including the required patches for PPGTT with 48b addressing. In order expand the GPU address space, a 4th level translation is added, the Page Map Level 4 (PML4). This PML4 has 256 PML4 Entries (PML4E), PML4[0-255], each pointing to a PDP.

For now, this feature will only be available in BDW and GEN9, in LRC submission mode (execlists) and when i915.enable_ppgtt=3 is set.
Also note that this expanded address space is only available for full PPGTT, aliasing PPGTT remains 32b.

This list can be seen in 3 parts:
[01-10] Add page table allocation for GEN6/GEN7 [11-20] Enable dynamic allocation in GEN8,for both legacy and execlist submission modes.
[21-32] PML4 support in BDW and GEN9+.

Ben Widawsky (26):
drm/i915: page table abstractions
drm/i915: Complete page table structures
drm/i915: Create page table allocators
drm/i915: Track GEN6 page table usage
drm/i915: Extract context switch skip and pd load logic drm/i915: Track page table reload need
drm/i915: Initialize all contexts
drm/i915: Finish gen6/7 dynamic page table allocation drm/i915/bdw: Use dynamic allocation idioms on free drm/i915/bdw: page directories rework allocation drm/i915/bdw: pagetable allocation rework
drm/i915/bdw: Update pdp switch and point unused PDPs to scratch page drm/i915: num_pd_pages/num_pd_entries isn't useful drm/i915: Extract PPGTT param from page_directory alloc drm/i915/bdw: Split out mappings
drm/i915/bdw: begin bitmap tracking
drm/i915/bdw: Dynamic page table allocations
drm/i915/bdw: Make pdp allocation more dynamic drm/i915/bdw: Abstract PDP usage
drm/i915/bdw: Add dynamic page trace events
drm/i915/bdw: Add ppgtt info for dynamic pages drm/i915/bdw: implement alloc/free for 4lvl
drm/i915/bdw: Add 4 level switching infrastructure drm/i915/bdw: Generalize PTE writing for GEN8 PPGTT drm/i915: Plumb sg_iter through va allocation ->maps drm/i915: Expand error state's address width to 64b

Quoted 7 lines

Michel Thierry (6):
drm/i915: Plumb drm_device through page tables operations drm/i915: Add dynamic page trace events
drm/i915/bdw: Support dynamic pdp updates in lrc mode drm/i915/bdw: Support 64 bit PPGTT in lrc mode drm/i915/bdw: Add 4 level support in insert_entries and clear_range drm/i915/bdw: Flip the 48b switch

When just a few patches changed (which I suspect is the case here) please don't resend the entire series, but only resend the individual patches in-reply-to their earlier versions.

Resending the entire series too often tends to split up the discussions between multiple threads, so should be used cautiously. My approach is that I don't resend the entire series except when all the patches have changed. And I only resend when the review round has reached a conclusion. While the review is ongoing doing incremental updates of the series is imo much better.

Quoted 9 lines

But when resending the entire series, please start a new thread. Otherwise it again starts to become unclear which versions of which patches go together.

And a quick aside if you fear that a patch causes subsequent patches to no longer apply without a rebase: I can deal with a lot of small conflicts quickly when merging. And if that doesn't cut it I'll just ask for a resend when needed.

I have been asking alot of stuff that triggers a rebasing. I suggest we should keep the 48b items in a separate series until we have most of the dynamic page table series sorted out.

- Mika

Quoted 12 lines

Just a quick reminder of patch resending bkms, intel-gfx is a really busy place so everyone needs to strive for best signal/noise ratio.

Thanks, Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#227 lore raw

Re: [PATCH v6 00/32] PPGTT dynamic page allocations and 48b addressing

Quoted 82 lines · Mika Kuoppala
Quoted 71 lines · Daniel Vetter
Quoted 52 lines · Michel Thierry

This patchset addresses comments from v5 by Mika, specially some rename changes touched several patches.

For GEN8, it has also been extended to work in logical ring submission (lrc) mode, as it will be the preferred mode of operation.
I also tried to update the lrc code at the same time the ppgtt refactoring occurred, leaving only one patch that is exclusively for lrc.

I'm also now including the required patches for PPGTT with 48b addressing. In order expand the GPU address space, a 4th level translation is added, the Page Map Level 4 (PML4). This PML4 has 256 PML4 Entries (PML4E), PML4[0-255], each pointing to a PDP.

For now, this feature will only be available in BDW and GEN9, in LRC submission mode (execlists) and when i915.enable_ppgtt=3 is set.
Also note that this expanded address space is only available for full PPGTT, aliasing PPGTT remains 32b.

This list can be seen in 3 parts:
[01-10] Add page table allocation for GEN6/GEN7 [11-20] Enable dynamic allocation in GEN8,for both legacy and execlist submission modes.
[21-32] PML4 support in BDW and GEN9+.

Ben Widawsky (26):
drm/i915: page table abstractions
drm/i915: Complete page table structures
drm/i915: Create page table allocators
drm/i915: Track GEN6 page table usage
drm/i915: Extract context switch skip and pd load logic drm/i915: Track page table reload need
drm/i915: Initialize all contexts
drm/i915: Finish gen6/7 dynamic page table allocation drm/i915/bdw: Use dynamic allocation idioms on free drm/i915/bdw: page directories rework allocation drm/i915/bdw: pagetable allocation rework
drm/i915/bdw: Update pdp switch and point unused PDPs to scratch page drm/i915: num_pd_pages/num_pd_entries isn't useful drm/i915: Extract PPGTT param from page_directory alloc drm/i915/bdw: Split out mappings
drm/i915/bdw: begin bitmap tracking
drm/i915/bdw: Dynamic page table allocations drm/i915/bdw: Make pdp allocation more dynamic drm/i915/bdw: Abstract PDP usage
drm/i915/bdw: Add dynamic page trace events
drm/i915/bdw: Add ppgtt info for dynamic pages drm/i915/bdw: implement alloc/free for 4lvl
drm/i915/bdw: Add 4 level switching infrastructure drm/i915/bdw: Generalize PTE writing for GEN8 PPGTT drm/i915: Plumb sg_iter through va allocation ->maps drm/i915: Expand error state's address width to 64b

Quoted 7 lines

Michel Thierry (6):
drm/i915: Plumb drm_device through page tables operations drm/i915: Add dynamic page trace events
drm/i915/bdw: Support dynamic pdp updates in lrc mode drm/i915/bdw: Support 64 bit PPGTT in lrc mode drm/i915/bdw: Add 4 level support in insert_entries and clear_range drm/i915/bdw: Flip the 48b switch

When just a few patches changed (which I suspect is the case here) please don't resend the entire series, but only resend the individual patches in-reply-to their earlier versions.

Resending the entire series too often tends to split up the discussions between multiple threads, so should be used cautiously. My approach is that I don't resend the entire series except when all the patches have changed. And I only resend when the review round has reached a conclusion. While the review is ongoing doing incremental updates of the series is imo much better.

Quoted 9 lines

But when resending the entire series, please start a new thread. Otherwise it again starts to become unclear which versions of which patches go together.

And a quick aside if you fear that a patch causes subsequent patches to no longer apply without a rebase: I can deal with a lot of small conflicts quickly when merging. And if that doesn't cut it I'll just ask for a resend when needed.

Quoted 5 lines

I have been asking alot of stuff that triggers a rebasing. I suggest we should keep the 48b items in a separate series until we have most of the dynamic page table series sorted out.

- Mika

Ok, I'll keep dynamic page allocation and 48b separated.

-Michel

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#228 lore raw

Re: [PATCH v6 00/32] PPGTT dynamic page allocations and 48b addressing

Quoted 83 lines · Michel Thierry
Quoted 82 lines · Mika Kuoppala
Quoted 80 lines · Daniel Vetter
Quoted 52 lines · Michel Thierry

This patchset addresses comments from v5 by Mika, specially some rename changes touched several patches.

For GEN8, it has also been extended to work in logical ring submission (lrc) mode, as it will be the preferred mode of operation.
I also tried to update the lrc code at the same time the ppgtt refactoring occurred, leaving only one patch that is exclusively for lrc.

I'm also now including the required patches for PPGTT with 48b addressing. In order expand the GPU address space, a 4th level translation is added, the Page Map Level 4 (PML4). This PML4 has 256 PML4 Entries (PML4E), PML4[0-255], each pointing to a PDP.

For now, this feature will only be available in BDW and GEN9, in LRC submission mode (execlists) and when i915.enable_ppgtt=3 is set.
Also note that this expanded address space is only available for full PPGTT, aliasing PPGTT remains 32b.

This list can be seen in 3 parts:
[01-10] Add page table allocation for GEN6/GEN7 [11-20] Enable dynamic allocation in GEN8,for both legacy and execlist submission modes.
[21-32] PML4 support in BDW and GEN9+.

Ben Widawsky (26):
drm/i915: page table abstractions
drm/i915: Complete page table structures
drm/i915: Create page table allocators
drm/i915: Track GEN6 page table usage
drm/i915: Extract context switch skip and pd load logic drm/i915: Track page table reload need
drm/i915: Initialize all contexts
drm/i915: Finish gen6/7 dynamic page table allocation drm/i915/bdw: Use dynamic allocation idioms on free drm/i915/bdw: page directories rework allocation drm/i915/bdw: pagetable allocation rework
drm/i915/bdw: Update pdp switch and point unused PDPs to scratch page drm/i915: num_pd_pages/num_pd_entries isn't useful drm/i915: Extract PPGTT param from page_directory alloc drm/i915/bdw: Split out mappings
drm/i915/bdw: begin bitmap tracking
drm/i915/bdw: Dynamic page table allocations
drm/i915/bdw: Make pdp allocation more dynamic drm/i915/bdw: Abstract PDP usage
drm/i915/bdw: Add dynamic page trace events
drm/i915/bdw: Add ppgtt info for dynamic pages drm/i915/bdw: implement alloc/free for 4lvl
drm/i915/bdw: Add 4 level switching infrastructure drm/i915/bdw: Generalize PTE writing for GEN8 PPGTT drm/i915: Plumb sg_iter through va allocation ->maps drm/i915: Expand error state's address width to 64b

Quoted 7 lines

Michel Thierry (6):
drm/i915: Plumb drm_device through page tables operations drm/i915: Add dynamic page trace events
drm/i915/bdw: Support dynamic pdp updates in lrc mode drm/i915/bdw: Support 64 bit PPGTT in lrc mode drm/i915/bdw: Add 4 level support in insert_entries and clear_range drm/i915/bdw: Flip the 48b switch

When just a few patches changed (which I suspect is the case here) please don't resend the entire series, but only resend the individual patches in-reply-to their earlier versions.

Resending the entire series too often tends to split up the discussions between multiple threads, so should be used cautiously. My approach is that I don't resend the entire series except when all the patches have changed. And I only resend when the review round has reached a conclusion. While the review is ongoing doing incremental updates of the series is imo much better.

But when resending the entire series, please start a new thread. Otherwise it again starts to become unclear which versions of which patches go together.

And a quick aside if you fear that a patch causes subsequent patches to no longer apply without a rebase: I can deal with a lot of small conflicts quickly when merging. And if that doesn't cut it I'll just ask for a resend when needed.

Quoted 6 lines
Quoted 5 lines

I have been asking alot of stuff that triggers a rebasing. I suggest we should keep the 48b items in a separate series until we have most of the dynamic page table series sorted out.

- Mika

Ok, I'll keep dynamic page allocation and 48b separated.

Yeah I didn't realize that these two have been merged. Another bkm is to keep patch-series for detailed code-review at 10-20 patches tops. More thens to just result in a lot more churn for every minimal rebase on the patch authors side. And also tends to burn out reviewers ime. -Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx