From: John Harrison <john.c.harrison@intel.com>
To: "Upadhyay, Tejas" <tejas.upadhyay@intel.com>,
"De Marchi, Lucas" <lucas.demarchi@intel.com>,
"Roper, Matthew D" <matthew.d.roper@intel.com>
Cc: "igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>,
"intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>,
"Brost, Matthew" <matthew.brost@intel.com>
Subject: Re: [PATCH V2 i-g-t] tests/xe_exec_threads: Make hang tests reset domain aware
Date: Fri, 5 Apr 2024 11:15:14 -0700 [thread overview]
Message-ID: <76010aec-7937-4e5a-afd2-672b338df8df@intel.com> (raw)
In-Reply-To: <SJ1PR11MB6204AA1AFB30BFEF7EBAA3D281032@SJ1PR11MB6204.namprd11.prod.outlook.com>
[-- Attachment #1: Type: text/plain, Size: 7845 bytes --]
On 4/4/2024 21:47, Upadhyay, Tejas wrote:
>> -----Original Message-----
>> From: Harrison, John C<john.c.harrison@intel.com>
>> Sent: Friday, April 5, 2024 4:53 AM
>> To: Upadhyay, Tejas<tejas.upadhyay@intel.com>; De Marchi, Lucas
>> <lucas.demarchi@intel.com>; Roper, Matthew D
>> <matthew.d.roper@intel.com>
>> Cc:igt-dev@lists.freedesktop.org;intel-xe@lists.freedesktop.org; Brost,
>> Matthew<matthew.brost@intel.com>
>> Subject: Re: [PATCH V2 i-g-t] tests/xe_exec_threads: Make hang tests reset
>> domain aware
>>
>> On 4/2/2024 22:35, Upadhyay, Tejas wrote:
>>>> -----Original Message-----
>>>> From: De Marchi, Lucas<lucas.demarchi@intel.com>
>>>> Sent: Wednesday, April 3, 2024 2:26 AM
>>>> To: Roper, Matthew D<matthew.d.roper@intel.com>
>>>> Cc: Upadhyay, Tejas<tejas.upadhyay@intel.com>; igt-
>>>> dev@lists.freedesktop.org;intel-xe@lists.freedesktop.org; Brost,
>>>> Matthew<matthew.brost@intel.com>
>>>> Subject: Re: [PATCH V2 i-g-t] tests/xe_exec_threads: Make hang tests
>>>> reset domain aware
>>>>
>>>> On Tue, Apr 02, 2024 at 12:40:17PM -0700, Matt Roper wrote:
>>>>> On Tue, Apr 02, 2024 at 05:52:23PM +0530, Tejas Upadhyay wrote:
>>>>>> RCS/CCS are dependent engines as they are sharing reset domain.
>>>>>> Whenever there is reset from CCS, all the exec queues running on
>>>>>> RCS are victimised mainly on Lunarlake.
>>>>>>
>>>>>> Lets skip parallel execution on CCS with RCS.
>>>>> I haven't really looked at this specific test in detail, but based
>>>>> on your explanation here, you're also going to run into problems
>>>>> with multiple CCS engines since they all share the same reset. You
>>>>> won't see that on platforms like LNL that only have a single CCS,
>>>>> but platforms
>>>> but it is seen on LNL because of having both RCS and CCS.
>>>>
>>>>> like PVC, ATS-M, DG2, etc. can all have multiple CCS where a reset
>>>>> on one kills anything running on the others.
>>>>>
>>>>>
>>>>> Matt
>>>>>
>>>>>> It helps in fixing following errors:
>>>>>> 1. Test assertion failure function test_legacy_mode, file, Failed
>>>>>> assertion: data[i].data == 0xc0ffee
>>>>>>
>>>>>> 2.Test assertion failure function xe_exec, file
>>>>>> ../lib/xe/xe_ioctl.c, Failed assertion: __xe_exec(fd, exec) == 0,
>>>>>> error: -125 != 0
>>>>>>
>>>>>> Signed-off-by: Tejas Upadhyay<tejas.upadhyay@intel.com>
>>>>>> ---
>>>>>> tests/intel/xe_exec_threads.c | 26 +++++++++++++++++++++++++-
>>>>>> 1 file changed, 25 insertions(+), 1 deletion(-)
>>>>>>
>>>>>> diff --git a/tests/intel/xe_exec_threads.c
>>>>>> b/tests/intel/xe_exec_threads.c index 8083980f9..31af61dc9 100644
>>>>>> --- a/tests/intel/xe_exec_threads.c
>>>>>> +++ b/tests/intel/xe_exec_threads.c
>>>>>> @@ -710,6 +710,17 @@ static void *thread(void *data)
>>>>>> return NULL;
>>>>>> }
>>>>>>
>>>>>> +static bool is_engine_contexts_victimized(int fd, unsigned int
>>>>>> +flags) {
>>>>>> + if (!IS_LUNARLAKE(intel_get_drm_devid(fd)))
>>>>>> + return false;
>>>> as above, I don't think we should add any platform check here. It's
>>>> impossible to keep it up to date and it's also testing the wrong thing.
>>>> AFAIU you don't want parallel submission on engines that share the
>>>> same reset domain. So, this is actually what should be tested.
>>> Platforms like PVC, ATS-M, DG2, etc. have some kind of WA/noWA which
>> helps to run things parallelly on engines in same reset domain and apparently
>> BMG/LNL does not have that kind of support so applicable for LNL/BMG with
>> parallel submission on RCS/CCS only.
>>> @Harrison, John C please reply if you have any other input here.
>> I don't get what you mean by 'have some kind of WA/noWA'. All platforms
>> with compute engines have shared reset domains. That is all there is to it. I.e.
>> everything from TGL onwards. That includes RCS and all CCS engines. So RCS +
>> CCS, CCS0 + CCS1, RCS + CC0 + CCS1, etc. Any platform with multiple engines
>> that talk to EUs will reset all of those engines in parallel.
>>
>> There are w/a's which make the situation even worse. E.g. on DG2/MTL you
>> are not allowed to context switch one of those engines while another is busy.
>> Which means that if one hangs, they all hang - you cannot just wait for other
>> workloads to complete and/or pre-empt them off the engine prior to doing
>> the shared reset. But there is nothing that makes it better.
>>
>> I assume we are talking about GuC triggered engine resets here? As opposed
>> to driver triggered full GT resets?
>>
>> The GuC will attempt to idle all other connected engines first by pre-empting
>> out any executing contexts. If those contexts are pre-emptible then they will
>> survive - GuC will automatically restart them once the reset is complete. If
>> they are not (or at least not pre-emptible within the pre-emption timeout
>> limit) then they will be killed as collateral damage.
>>
>> What are the workloads being submitted by this test? Are the pre-emptible
>> spinners? If so, then they should survive (assuming you don't have the
>> DG2/MTL RCS/CCS w/a in effect). If they are non-preemptible spinners then
>> they are toast.
> Main question here was, if this fix should be applied to all platforms who has RCS and CCS both or just LNL/BMG. Reason to ask is, only LNL/BMG are hitting this issue, with same tests PVC and other platforms are not hitting issue which we are addressing here.
And the answer is that yes, shared reset domains are common to all
platforms with compute engines. So if only LNL/BMG are failing then the
problem is not understood. Which is not helped by this test code being
extremely complex and having almost zero explanation in it at all :(.
As noted, PVC has multiple compute engines but no RCS engine. If any
compute engine is reset then all are reset. So if the test is running
correctly and passing on PVC then it cannot be failing on LNL/BMG purely
due to shared domain resets.
Is the reset not happening on PVC? Is the test not actually running
multiple contexts in parallel on PVC? Or are the spinners pre-emptible
and are therefore supposed to survive the reset of a shared domain
engine by being swapped out first? In which case LNL/BMG are broken
because the killed contexts are not supposed to be killed even though
the engine is reset?
John.
>
> Thanks,
> Tejas
>> John.
>>
>>
>>> Thanks,
>>> Tejas
>>>> Lucas De Marchi
>>>>
>>>>>> +
>>>>>> + if (flags & HANG)
>>>>>> + return true;
>>>>>> +
>>>>>> + return false;
>>>>>> +}
>>>>>> +
>>>>>> /**
>>>>>> * SUBTEST: threads-%s
>>>>>> * Description: Run threads %arg[1] test with multi threads @@
>>>>>> -955,9 +966,13 @@ static void threads(int fd, int flags)
>>>>>> bool go = false;
>>>>>> int n_threads = 0;
>>>>>> int gt;
>>>>>> + bool has_rcs = false;
>>>>>>
>>>>>> - xe_for_each_engine(fd, hwe)
>>>>>> + xe_for_each_engine(fd, hwe) {
>>>>>> + if (hwe->engine_class == DRM_XE_ENGINE_CLASS_RENDER)
>>>>>> + has_rcs = true;
>>>>>> ++n_engines;
>>>>>> + }
>>>>>>
>>>>>> if (flags & BALANCER) {
>>>>>> xe_for_each_gt(fd, gt)
>>>>>> @@ -990,6 +1005,15 @@ static void threads(int fd, int flags)
>>>>>> }
>>>>>>
>>>>>> xe_for_each_engine(fd, hwe) {
>>>>>> + /* RCS/CCS sharing reset domain hence dependent engines.
>>>>>> + * When CCS is doing reset, all the contexts of RCS are
>>>>>> + * victimized, so skip the compute engine avoiding
>>>>>> + * parallel execution with RCS
>>>>>> + */
>>>>>> + if (has_rcs && hwe->engine_class ==
>>>> DRM_XE_ENGINE_CLASS_COMPUTE &&
>>>>>> + is_engine_contexts_victimized(fd, flags))
>>>>>> + continue;
>>>>>> +
>>>>>> threads_data[i].mutex = &mutex;
>>>>>> threads_data[i].cond = &cond;
>>>>>> #define ADDRESS_SHIFT 39
>>>>>> --
>>>>>> 2.25.1
>>>>>>
>>>>> --
>>>>> Matt Roper
>>>>> Graphics Software Engineer
>>>>> Linux GPU Platform Enablement
>>>>> Intel Corporation
[-- Attachment #2: Type: text/html, Size: 10882 bytes --]
next prev parent reply other threads:[~2024-04-05 18:15 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-02 12:22 [PATCH V2 i-g-t] tests/xe_exec_threads: Make hang tests reset domain aware Tejas Upadhyay
2024-04-02 12:15 ` ✗ CI.Patch_applied: failure for " Patchwork
2024-04-02 19:40 ` [PATCH V2 i-g-t] " Matt Roper
2024-04-02 20:55 ` Lucas De Marchi
2024-04-03 5:35 ` Upadhyay, Tejas
2024-04-04 23:22 ` John Harrison
2024-04-04 23:45 ` John Harrison
2024-04-05 4:42 ` Upadhyay, Tejas
2024-04-05 4:47 ` Upadhyay, Tejas
2024-04-05 18:15 ` John Harrison [this message]
2024-04-05 23:33 ` Matthew Brost
2024-04-05 23:42 ` John Harrison
2024-04-08 5:23 ` Upadhyay, Tejas
2024-04-08 12:00 ` Upadhyay, Tejas
2024-04-10 19:22 ` John Harrison
2024-04-11 5:12 ` Upadhyay, Tejas
2024-04-11 5:37 ` Upadhyay, Tejas
2024-04-23 13:06 ` Upadhyay, Tejas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=76010aec-7937-4e5a-afd2-672b338df8df@intel.com \
--to=john.c.harrison@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=lucas.demarchi@intel.com \
--cc=matthew.brost@intel.com \
--cc=matthew.d.roper@intel.com \
--cc=tejas.upadhyay@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox