Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
To: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
Cc: igt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
	Kamil Konieczny <kamil.konieczny@linux.intel.com>,
	Andi Shyti <andi.shyti@linux.intel.com>,
	Krzysztof Karas	 <krzysztof.karas@intel.com>,
	Sebastian Brzezinka <sebastian.brzezinka@intel.com>,
	 Krzysztof Niemiec <krzysztof.niemiec@intel.com>
Subject: Re: [PATCH i-g-t 2/2] tests/intel/gem_close_race: Skip offset probing without full-ppgtt
Date: Fri, 25 Sep 2026 11:47:41 +0200	[thread overview]
Message-ID: <5fc31c9b0fd3e9fc469102b726174e165bec8161.camel@linux.intel.com> (raw)
In-Reply-To: <7tycj7qmuxox256zwdz57uictfkg4fdufzvkfnwg3z4wrujnmd@oi6lpt7yhtz5>

Hi Zbyszek,

Thanks for looking at this.

On Fri, 2026-09-25 at 10:40 +0200, Zbigniew Kempczyński wrote:
> On Thu, Sep 24, 2026 at 05:24:18PM +0200, Janusz Krzysztofik wrote:
> > gem_close_race computed exec_addr/data_addr via
> > gem_detect_safe_start_offset() and gem_detect_safe_alignment()
> > whenever the kernel disallowed relocations, without checking ppgtt
> > mode. Those helpers exist solely to bootstrap intel_allocator and are
> > meaningless without full-ppgtt, since the kernel can't see the ranges
> > intel_allocator considers reserved and may hand them out to other
> > users, as already acknowledged by __intel_bb_create() which enforces
> > relocations and skips the allocator entirely in that case.
> > 
> > Require gem_uses_full_ppgtt() as well before enabling the softpin
> > path, mirroring __intel_bb_create()'s logic, and skip the probing
> > calls otherwise so the existing relocation fallback is used.
> > 
> > Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
> > Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> > Assisted-by: GitHub Copilot (Claude Sonnet 5)
> > ---
> >  tests/intel/gem_close_race.c | 19 ++++++++++++++-----
> >  1 file changed, 14 insertions(+), 5 deletions(-)
> > 
> > diff --git a/tests/intel/gem_close_race.c b/tests/intel/gem_close_race.c
> > index b2688774d7..ff2877f67e 100644
> > --- a/tests/intel/gem_close_race.c
> > +++ b/tests/intel/gem_close_race.c
> > @@ -348,11 +348,20 @@ int igt_main()
> >  
> >  		devid = intel_get_drm_devid(fd);
> >  		has_64bit_relocations = intel_gen(devid) >= 8;
> > -		has_softpin = !gem_has_relocations(fd);
> > -		exec_addr = gem_detect_safe_start_offset(fd);
> > -		data_addr = gem_detect_safe_alignment(fd);
> > -		exec_addr = max_t(exec_addr, exec_addr, data_addr);
> > -		data_addr += exec_addr;
> > +		/*
> > +		 * Without full-ppgtt the kernel can't see the ranges the
> > +		 * detected offsets are meant to reserve and may hand them
> > +		 * out to other users, so pinning at a detected offset isn't
> > +		 * meaningful; fall back to relocations in that case, same
> > +		 * as __intel_bb_create() does.
> > +		 */
> > +		has_softpin = !gem_has_relocations(fd) && gem_uses_full_ppgtt(fd);
> 
> Which platforms don't have relocations and are not using full ppgtt?

Correct, today all configurations without relocations also expose full
PPGTT, so the added check does not currently change runtime behavior.
However, the purpose of the check is not to distinguish existing platforms.
The probing helpers are conceptually valid only with full PPGTT, as they
rely on allocator-managed address space reservations being respected by the
kernel. Therefore I would prefer to keep the explicit gem_uses_full_ppgtt()
requirement to document that dependency and to keep the code aligned with
the logic already described in __intel_bb_create().  The condition is
intentionally expressing the semantic requirement of the helpers, not
distinguishing currently known hardware configurations.

Thanks,
Janusz

> 
> --
> Zbigniew
> 
> > +		if (has_softpin) {
> > +			exec_addr = gem_detect_safe_start_offset(fd);
> > +			data_addr = gem_detect_safe_alignment(fd);
> > +			exec_addr = max_t(exec_addr, exec_addr, data_addr);
> > +			data_addr += exec_addr;
> > +		}
> >  
> >  		gpu_count = igt_device_filter_count();
> >  
> > -- 
> > 2.55.0
> > 

  reply	other threads:[~2026-09-25  9:48 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-24 15:24 [PATCH i-g-t 0/2] tests/intel: Don't probe intel_allocator offsets without full-ppgtt Janusz Krzysztofik
2026-09-24 15:24 ` [PATCH i-g-t 1/2] tests/intel/gem_softpin: Skip safe-alignment " Janusz Krzysztofik
2026-09-25  7:54   ` Zbigniew Kempczyński
2026-09-25  9:30   ` Krzysztof Karas
2026-09-24 15:24 ` [PATCH i-g-t 2/2] tests/intel/gem_close_race: Skip offset probing " Janusz Krzysztofik
2026-09-25  8:40   ` Zbigniew Kempczyński
2026-09-25  9:47     ` Janusz Krzysztofik [this message]
2026-10-06 14:27       ` Kamil Konieczny
2026-09-25 10:41   ` Krzysztof Karas
2026-09-24 18:10 ` ✓ i915.CI.BAT: success for tests/intel: Don't probe intel_allocator offsets " Patchwork
2026-09-24 19:13 ` ✓ Xe.CI.BAT: " Patchwork
2026-09-25  8:08 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-09-25 21:21 ` ✗ i915.CI.Full: " Patchwork
2026-10-01 17:22 ` ✓ i915.CI.BAT: success for tests/intel: Don't probe intel_allocator offsets without full-ppgtt (rev2) Patchwork
2026-10-01 21:09 ` ✓ Xe.CI.BAT: " Patchwork
2026-10-02  1:49 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-10-02 23:08 ` ✗ i915.CI.Full: " Patchwork
2026-10-05  8:13   ` Janusz Krzysztofik
2026-10-05 11:32     ` Ravali, JupallyX
2026-10-05 11:27 ` ✓ i915.CI.Full: success " 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=5fc31c9b0fd3e9fc469102b726174e165bec8161.camel@linux.intel.com \
    --to=janusz.krzysztofik@linux.intel.com \
    --cc=andi.shyti@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=kamil.konieczny@linux.intel.com \
    --cc=krzysztof.karas@intel.com \
    --cc=krzysztof.niemiec@intel.com \
    --cc=sebastian.brzezinka@intel.com \
    --cc=zbigniew.kempczynski@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