Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
To: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
Cc: igt-dev@lists.freedesktop.org, Petri Latvala <petri.latvala@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t] i915: Skip two subsets when pread/pwrite are unavailable
Date: Fri, 26 Mar 2021 00:23:54 -0700	[thread overview]
Message-ID: <87ft0i2x9x.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <20210326065853.GA3927@zkempczy-mobl2>

On Thu, 25 Mar 2021 23:58:53 -0700, Zbigniew Kempczyński wrote:
>
> On Thu, Mar 25, 2021 at 09:33:03PM -0700, Ashutosh Dixit wrote:
> > The pread/pwrite replacement implemented in
> > ad5eb02eb3f1 ("lib/ioctl_wrappers: Keep IGT working without pread/pwrite
> > ioctls") uses gem_set_domain which pins all pages which have to be
> > read/written. When the read/write size is large this causes gem_set_domain
> > to return -ENOMEM with a trace such as:
> >
> > ioctl_wrappers-CRITICAL: Test assertion failure function gem_set_domain, file ../lib/ioctl_wrappers.c:563:
> > ioctl_wrappers-CRITICAL: Failed assertion: __gem_set_domain(fd, handle, read, write) == 0
> > ioctl_wrappers-CRITICAL: Last errno: 12, Cannot allocate memory
> > ioctl_wrappers-CRITICAL: error: -12 != 0
> > igt_core-INFO: Stack trace:
> > igt_core-INFO:   #0 ../lib/igt_core.c:1746 __igt_fail_assert()
> > igt_core-INFO:   #1 [gem_set_domain+0x44]
> > igt_core-INFO:   #2 ../lib/ioctl_wrappers.c:367 gem_write()
> > igt_core-INFO:   #3 ../tests/prime_mmap.c:67 test_aperture_limit()
> > igt_core-INFO:   #4 ../tests/prime_mmap.c:578 __real_main530()
> > igt_core-INFO:   #5 ../tests/prime_mmap.c:530 main()
> >
> > Skip these tests when pread/pwrite are unavailable because they cannot pass
> > with the pread/pwrite replacement.
> >
> > Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
> > ---
> >  tests/i915/gem_exec_params.c | 2 ++
> >  tests/prime_mmap.c           | 2 ++
> >  2 files changed, 4 insertions(+)
> >
> > diff --git a/tests/i915/gem_exec_params.c b/tests/i915/gem_exec_params.c
> > index 6840cf40ce..a7bcd39d32 100644
> > --- a/tests/i915/gem_exec_params.c
> > +++ b/tests/i915/gem_exec_params.c
> > @@ -314,6 +314,8 @@ static void test_larger_than_life_batch(int fd)
> >	 */
> >	igt_require(size < gem_aperture_size(fd));
> >	intel_require_memory(2, size, CHECK_RAM); /* batch + shadow */
> > +	/* Prevent gem_set_domain -ENOMEM failures */
> > +	gem_require_pread_pwrite(fd);
>
> I have doubts regarding that test.
>
> What is real cause we got -ENOMEM in that subtest?

Hi Zbyszek, I explained this in the commit message:

gem_set_domain pins all pages which have to be read/written. When the
read/write size is large this causes gem_set_domain to return -ENOMEM.

> And on which machines?

Not sure about which machines but I saw some CI failures.

> I've enforced on my SKL (gen9) to use mmap/set_domain and I see success
> on that test.

OK good to know that it only fails on some machines, not always.

>
> Why require:
>
>	igt_require(size < gem_aperture_size(fd));
>
> comes after:
>
>	uint64_t size = 1ULL << 32; /* batch_len is __u32 as per the ABI */
>	struct drm_i915_gem_exec_object2 exec = {
>		.handle = batch_create_size(fd, size),
>	};
>
> I think require before mmap/set_domain would catch this issue.

Thanks, you are right, there is a bug in the patch,
gem_require_pread_pwrite() should be before batch_create_size() which
contains the gem_write(). Actually all these igt_require's should be before
batch_create_size() like you say. May not even need the
gem_require_pread_pwrite().

The failure was same for the prime_mmap below.

I will try and repost the patch. Thanks.

>
> --
> Zbigniew
>
> >
> >	__for_each_physical_engine(fd, e) {
> >		/* Keep the batch_len implicit [0] */
> > diff --git a/tests/prime_mmap.c b/tests/prime_mmap.c
> > index cdf2d51497..af313917da 100644
> > --- a/tests/prime_mmap.c
> > +++ b/tests/prime_mmap.c
> > @@ -451,6 +451,8 @@ test_aperture_limit(void)
> >	uint64_t size1 = (gem_mappable_aperture_size(fd) * 7) / 8;
> >	uint64_t size2 = (gem_mappable_aperture_size(fd) * 3) / 8;
> >
> > +	/* Prevent gem_set_domain -ENOMEM failures */
> > +	gem_require_pread_pwrite(fd);
> >	handle1 = gem_create(fd, size1);
> >	fill_bo(handle1, BO_SIZE);
> >
> > --
> > 2.29.2
> >
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2021-03-26  7:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-26  4:33 [igt-dev] [PATCH i-g-t] i915: Skip two subsets when pread/pwrite are unavailable Ashutosh Dixit
2021-03-26  5:12 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
2021-03-26  5:34   ` Dixit, Ashutosh
2021-03-26  6:29     ` Vudum, Lakshminarayana
2021-03-26  6:19 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2021-03-26  6:58 ` [igt-dev] [PATCH i-g-t] " Zbigniew Kempczyński
2021-03-26  7:23   ` Dixit, Ashutosh [this message]
2021-03-26 10:41 ` [igt-dev] ✗ Fi.CI.IGT: failure for " 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=87ft0i2x9x.wl-ashutosh.dixit@intel.com \
    --to=ashutosh.dixit@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=petri.latvala@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