public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
To: Krzysztof Niemiec <krzysztof.niemiec@intel.com>
Cc: igt-dev@lists.freedesktop.org,
	Andi Shyti <andi.shyti@linux.intel.com>,
	 Krzysztof Karas <krzysztof.karas@intel.com>,
	Sebastian Brzezinka <sebastian.brzezinka@intel.com>
Subject: Re: [PATCH i-g-t v2] tests/intel/gem_exec_endless: Use the per-gt interface to set frequencies
Date: Thu, 09 Apr 2026 14:28:46 +0200	[thread overview]
Message-ID: <14d365148cf89a71539cd47da3eb8ad4dedfe388.camel@linux.intel.com> (raw)
In-Reply-To: <lebova5umd6qiypupwch4wunqut7symicwhhuf3hxaa3x4p3qa@kuervnvpa4yy>

Hi Krzysztof,

Thanks for explanation.  Based on that ...

On Thu, 2026-04-09 at 13:46 +0200, Krzysztof Niemiec wrote:
> On 2026-04-07 at 13:42:20 GMT, Janusz Krzysztofik wrote:
> > Hi Krzysztof,
> > 
> > On Tue, 2026-04-07 at 12:52 +0200, Krzysztof Niemiec wrote:
> > > The test alters the environment, specifically the gt frequencies, for
> > > its duration. Using the legacy interface however makes it impossible for
> > > the pre-test state to be restored due to its limitations in multi-gt
> > > systems. 

... because each gt may accept values from a different range and default to
a different value that we may want to restore.

Or something similar.  That won't be too verbose, I believe.

Thanks,
Janusz


> > > Use the per-gt interface instead to properly clean up.
> > 
> > While I think your solution may be correct, your description is not clear 
> > enough for me.  How is it possible for the legacy interface to work as 
> > expected when altering the environment, but not ant longer when restoring 
> > defaults?
> > 
> 
> The legacy interface can only ever emit a singular value to the GTs (the
> same value to all at once), while the per-gt interface allows granular
> control.
> 
> So, for example, say we have two GTs - gt0 and gt1. You can set the
> frequency values (min_freq, max_freq, boost_freq are the ones set by the
> test) to those that fall in the range in between RPn and RP0. These
> values can be different for different GTs, these are from the test box
> I've been testing the patch on:
> 
> 	root@box:/sys/class/drm/card1# cat gt/gt0/rps_RPn_freq_mhz
> 	800
> 	root@box:/sys/class/drm/card1# cat gt/gt1/rps_RPn_freq_mhz
> 	100
> 
> 	root@box:/sys/class/drm/card1# cat gt/gt0/rps_RP0_freq_mhz
> 	2200
> 	root@box:/sys/class/drm/card1# cat gt/gt1/rps_RP0_freq_mhz
> 	1300
> 
> So gt0 accepts values from the range 800-2200, but gt1 accepts values
> from the range 100-1300.
> 
> However, the legacy interface reports only one set of these values:
> 
> 	root@box:/sys/class/drm/card1# cat gt_RPn_freq_mhz
> 	800
> 	root@box:/sys/class/drm/card1# cat gt_RP0_freq_mhz
> 	2200
> 
> Now, without the patch, the test looks at the legacy interface's RP0 and
> RPn value to alter the environment, showing a range of 800-2200. The
> test sets all frequencies to max (so 2200, as read from the legacy
> interface). This actually fails silently for gt1 in this example:
> 
> 	root@box:/sys/class/drm/card1# echo 1300 > gt_min_freq_mhz
> 	root@box:/sys/class/drm/card1# echo 2200 > gt_min_freq_mhz
> 	-bash: echo: write error: Invalid argument
> 
> (the failure is silent because the test doesn't check for a return value).
> gt0 is set properly, gt1 stays at 100. This is because we cannot have
> the information for gt1's range of allowed values, since the legacy
> interface reports the max of these two. Changing it to the minimum of
> the two values will prevent a failure in gt1, but then gt0 will be set
> to 1300 while it can be still raised to 2200, so we're not actually
> setting the maximum value for it, which the test is trying to do. The
> per-gt interface just treats both GTs independently, reading the correct
> range for all of them, so this issue doesn't arise.
> 
> Then, after the test is finished, the test tries to set the values back
> to what RP0 and RPn report. Let's look at the min_freq because this is a
> cause for problems in further tests that expect a restored environment.
> 
> After test init, as I described earlier, the values for min_freq are
> 2200 and 100 for gt0 and gt1 respectively. During cleanup, the test reads
> RPn from the legacy interface, which is 800, and then sets the min_freq
> (using the legacy interface too) to this value. Now, since 800 is both in
> the 100-1300 and the 800-2200 range, this will succeed; after this values
> for min_freq are 800 and 800 for gt0 and gt1. This is a mismatch with
> the original values being 800 and 100 for gt0 and gt1.
> 
> Note that reporting 100 from the legacy interface instead won't fix the
> problem either, as then min_freq for gt1 would be correctly set to 100,
> but setting it for gt0 would fail (100 is not in 800-2200), so the test
> would leave the values at 2200 and 100, respectively, still not
> restoring the environment properly. This is just impossible to
> accomplish using the legacy interface, because it can only ever report a
> single value for any of the attributes.
> 
> To explain this in detail could be unneccesarily verbose for a git log,
> but if you think it's needed, I can include it.
> 
> Thanks
> Krzysztof
> 
> > Thanks,
> > Janusz
> > 

  reply	other threads:[~2026-04-09 12:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-07 10:52 [PATCH i-g-t v2] tests/intel/gem_exec_endless: Use the per-gt interface to set frequencies Krzysztof Niemiec
2026-04-07 11:42 ` Janusz Krzysztofik
2026-04-09 11:46   ` Krzysztof Niemiec
2026-04-09 12:28     ` Janusz Krzysztofik [this message]
2026-04-09 14:01       ` Krzysztof Niemiec
2026-04-09  7:43 ` ✓ Xe.CI.BAT: success for tests/intel/gem_exec_endless: Use the per-gt interface to set frequencies (rev2) Patchwork
2026-04-09  7:56 ` ✓ i915.CI.BAT: " Patchwork
2026-04-09  8:52 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-04-09 19:54 ` ✗ i915.CI.Full: " Patchwork

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=14d365148cf89a71539cd47da3eb8ad4dedfe388.camel@linux.intel.com \
    --to=janusz.krzysztofik@linux.intel.com \
    --cc=andi.shyti@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=krzysztof.karas@intel.com \
    --cc=krzysztof.niemiec@intel.com \
    --cc=sebastian.brzezinka@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