CCS static load balance
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest15 patches 8 repliesIn review
- v3 posting 2/215 patches 7 repliesSuperseded
- v3 posting 1/20 of 15 patches 0 repliesSuperseded
Earlier versions · 3
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v2 posting 2/2 | 15 patches | 0 replies | Superseded | |
| v2 RFC posting 1/2 | 11 patches | 0 replies | Superseded | |
| v1 RFC | 9 patches | 0 replies | Superseded |
Changelog from the cover letter
==========
PATCHv3 -> PATCHv4
------------------
- Rebase on top of the latest drm-tip
- Do not call functions inside GEM_BUG_ONs, but call them explicitly (thanks Arshad).
Patches in v4 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/15 | drm/i915/gt: Avoid using masked workaround for CCS_MODE settingdrivers/ | +1 | 1 reply | |
| 2/15 | drm/i915/gt: Move the CCS mode variable to a global positiondrivers/ drivers/ drivers/ +2 more | +30 | 0 replies | |
| 3/15 | drm/i915/gt: Allow the creation of multi-mode CCS masksdrivers/ drivers/ | +72 | 0 replies | |
| 4/15 | drm/i915/gt: Refactor uabi engine class/instance list creationdrivers/ | +17 | 0 replies | |
| 5/15 | drm/i915/gem: Mark and verify UABI engine validitydrivers/ drivers/ | +33 | 0 replies | |
| 6/15 | drm/i915/gt: Introduce for_each_enabled_engine() and apply it in selftestsdrivers/ drivers/ drivers/ +14 more | +102 | 0 replies | |
| 7/15 | drm/i915/gt: Manage CCS engine creation within UABI exposuredrivers/ drivers/ | +14 | 0 replies | |
| 8/15 | drm/i915/gt: Remove cslices mask value from the CCS structuredrivers/ drivers/ | +1 | 0 replies | |
| 9/15 | drm/i915/gt: Expose the number of total CCS slicesdrivers/ drivers/ drivers/ | +24 | 0 replies | |
| 10/15 | drm/i915/gt: Store engine-related sysfs kobjectsdrivers/ drivers/ drivers/ | +7 | 0 replies | |
| 11/15 | drm/i915/gt: Store active CCS maskdrivers/ drivers/ | +44 | 0 replies | |
| 12/15 | drm/i915: Protect access to the UABI engines list with a mutexdrivers/ drivers/ drivers/ +7 more | +59 | 0 replies | |
| 13/15 | drm/i915/gt: Isolate single sysfs engine file creationdrivers/ drivers/ | +49 | 0 replies | |
| 14/15 | drm/i915/gt: Implement creation and removal routines for CCS enginesdrivers/ | +128 | 0 replies | |
| 15/15 | drm/i915/gt: Allow the user to change the CCS mode through sysfsdrivers/ | +80 | 0 replies |
Reviews trailers per patch
None of the 15 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Michal Mrozek | Arshad Mehmood | Usharani Ayyalasomayajula |
|---|---|---|---|
| Series | A-b | A-b | A-b |
| 1/15 | |||
| 2/15 | |||
| 3/15 | |||
| 4/15 | |||
| 5/15 | |||
| 6/15 | |||
| 7/15 | |||
| 8/15 | |||
| 9/15 | |||
| 10/15 | |||
| 11/15 | |||
| 12/15 | |||
| 13/15 | |||
| 14/15 | |||
| 15/15 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.
Cover letter [PATCH v4 00/15] CCS static load balance
Hi,
Back in v3, this patch series was turned down due to community policies regarding i915 GEM development. Since then, I have received several requests from userspace developers, which I initially declined in order to respect those policies.
However, with the latest request from UMD users, I decided to give this series another chance. I believe that when a feature is genuinely needed, our goal should be to support it, not to dismiss user and customer needs blindly.
Here is the link to the userspace counterpart, which depends on this series to function properly[*].
I've been refreshing and testing the series together with Arshad.
This patchset introduces static load balancing for GPUs with multiple compute engines. It's a relatively long series.
To help with review, I've broken the work down as much as possible in multiple patches.
To summarise:
- Patches 1 to 14 introduce no functional changes, aside from adding the 'num_cslices' interface.
- Patch 15 contains the core of the CCS mode setting, building on the earlier groundwork.
The updated approach focuses on managing the UABI engine list, which controls which engines are exposed to userspace. Instead of manipulating physical engines and their memory directly, we now control exposure via this list.
Since v3, I've kept the changes in v4 to a minimum because there wasn't a real technical review on the previous posting. I would really appreciate it if this time all technical concerns could be raised and discussed on the mailing list.
IGT tests for this work exist but haven't been submitted yet.
Thanks to Chris for the reviews, to Arshad for the work we've done together over the past few weeks, and to Michal for his invaluable input from the userspace side.
Thanks,
Andi
[*] https://github.com/intel/compute-runtime
Changelog:
==========
PATCHv3 -> PATCHv4
------------------
- Rebase on top of the latest drm-tip
- Do not call functions inside GEM_BUG_ONs, but call them explicitly (thanks Arshad).
PATCHv2 -> PATCHv3
------------------
- Fix a NULL pointer dereference during module unload. In i915_gem_driver_remove() I was accessing the gt after the gt was removed. Use the dev_priv, instead (obviously!).
- Fix a lockdep issue: Some of the uabi_engines_mutex unlocks were not correctly placed in the exit paths.
- Fix a checkpatch error for spaces after and before parenthesis in the for_each_enabled_engine() definition.
PATCHv1 -> PATCHv2
------------------
- Use uabi_mutex to protect the uabi_engines, not the engine itself. Rename it to uabi_engines_mutex.
- Use kobject_add/kobject_del for adding and removing interfaces, this way we don't need to destroy and recreate the engines, anymore. Refactor intel_engine_add_single_sysfs() to reflect this scenario.
- After adding engines to the rb_tree check that they have been added correctly.
- Fix rb_find_add() compare function to take into accoung also the class, not just the instance.
RFCv2 -> PATCHv1
----------------
- Removed gt->ccs.mutex
- Rename m -> width, ccs_id -> engine in intel_gt_apply_ccs_mode().
- In the CCS register value calculation (intel_gt_apply_ccs_mode()) the engine (ccs_id) needs to move along the ccs_mask (set by the user) instead of the cslice_mask.
- Add GEM_BUG_ON after calculating the new ccs_mask (update_ccs_mask()) to make sure all angines have been evaluated (i.e. ccs_mask must be '0' at the end of the algorithm).
- move wakeref lock before evaluating intel_gt_pm_is_awake() and fix exit path accordingly.
- Use a more compact form in intel_gt_sysfs_ccs_init() and add_uabi_ccs_engines() when evaluating sysfs_create_file(): no need to store the return value to the err variable which is unused. Get rid of err.
- Print a warnging instead of a debug message if we fail to create the sysfs files.
- If engine files creation fails in intel_engine_add_single_sysfs(), print a warning, not an error.
- Rename gt->ccs.ccs_mask to gt->ccs.id_mask and add a comment to explain its purpose.
- During uabi engine creation, in intel_engines_driver_register(), the uabi_ccs_instance is redundant because the ccs_instances is already tracked in engine->uabi_instance.
- Mark add_uabi_ccs_engines() and remove_uabi_ccs_engines() as __maybe_unused not to break bisectability. They wouldn't compile in their own commit. They will be used in the next patch and the __maybe_unused is removed.
- Update engine's workaround every time a new mode is set in update_ccs_mask().
- Mark engines as valid or invalid using their status as rb_node. Invalid engines are marked as invalid using RB_CLEAR_NODE(). Execbufs will check for their validity when selecting the engine to be combined to a context.
- Create for_each_enabled_engine() which skips the non valid engines and use it in selftests.
RFCv1 -> RFCv2
--------------
Compared to the first version I've taken a completely different approach to adding and removing engines. in v1 physical engines were directly added and removed, along with the memory allocated to them, each time the user changed the CCS mode (from the previous cover letter).
Andi Shyti (15):
drm/i915/gt: Avoid using masked workaround for CCS_MODE setting drm/i915/gt: Move the CCS mode variable to a global position drm/i915/gt: Allow the creation of multi-mode CCS masks drm/i915/gt: Refactor uabi engine class/instance list creation drm/i915/gem: Mark and verify UABI engine validity drm/i915/gt: Introduce for_each_enabled_engine() and apply it in
selftests
drm/i915/gt: Manage CCS engine creation within UABI exposure drm/i915/gt: Remove cslices mask value from the CCS structure drm/i915/gt: Expose the number of total CCS slices drm/i915/gt: Store engine-related sysfs kobjects drm/i915/gt: Store active CCS mask
drm/i915: Protect access to the UABI engines list with a mutex drm/i915/gt: Isolate single sysfs engine file creation drm/i915/gt: Implement creation and removal routines for CCS engines drm/i915/gt: Allow the user to change the CCS mode through sysfs
drivers/gpu/drm/i915/gem/i915_gem_context.c | 3 + .../gpu/drm/i915/gem/i915_gem_execbuffer.c | 28 +- drivers/gpu/drm/i915/gt/intel_engine_cs.c | 23 -- drivers/gpu/drm/i915/gt/intel_engine_types.h | 2 + drivers/gpu/drm/i915/gt/intel_engine_user.c | 62 ++- drivers/gpu/drm/i915/gt/intel_gt.c | 3 + drivers/gpu/drm/i915/gt/intel_gt.h | 12 + drivers/gpu/drm/i915/gt/intel_gt_ccs_mode.c | 357 +++++++++++++++++- drivers/gpu/drm/i915/gt/intel_gt_ccs_mode.h | 5 +- drivers/gpu/drm/i915/gt/intel_gt_sysfs.c | 2 + drivers/gpu/drm/i915/gt/intel_gt_types.h | 19 +- drivers/gpu/drm/i915/gt/intel_workarounds.c | 8 +- drivers/gpu/drm/i915/gt/selftest_context.c | 6 +- drivers/gpu/drm/i915/gt/selftest_engine_cs.c | 4 +- .../drm/i915/gt/selftest_engine_heartbeat.c | 6 +- drivers/gpu/drm/i915/gt/selftest_engine_pm.c | 6 +- drivers/gpu/drm/i915/gt/selftest_execlists.c | 52 +-- drivers/gpu/drm/i915/gt/selftest_gt_pm.c | 2 +- drivers/gpu/drm/i915/gt/selftest_hangcheck.c | 22 +- drivers/gpu/drm/i915/gt/selftest_lrc.c | 18 +- drivers/gpu/drm/i915/gt/selftest_mocs.c | 6 +- drivers/gpu/drm/i915/gt/selftest_rc6.c | 4 +- drivers/gpu/drm/i915/gt/selftest_reset.c | 8 +- .../drm/i915/gt/selftest_ring_submission.c | 2 +- drivers/gpu/drm/i915/gt/selftest_rps.c | 14 +- drivers/gpu/drm/i915/gt/selftest_timeline.c | 14 +- drivers/gpu/drm/i915/gt/selftest_tlb.c | 2 +- .../gpu/drm/i915/gt/selftest_workarounds.c | 14 +- drivers/gpu/drm/i915/gt/sysfs_engines.c | 80 ++-- drivers/gpu/drm/i915/gt/sysfs_engines.h | 2 + drivers/gpu/drm/i915/i915_cmd_parser.c | 2 + drivers/gpu/drm/i915/i915_debugfs.c | 4 + drivers/gpu/drm/i915/i915_drv.h | 5 + drivers/gpu/drm/i915/i915_gem.c | 4 + drivers/gpu/drm/i915/i915_perf.c | 8 +- drivers/gpu/drm/i915/i915_pmu.c | 11 +- drivers/gpu/drm/i915/i915_query.c | 21 +- 37 files changed, 648 insertions(+), 193 deletions(-)
Signature · 1 line
2.47.2