public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Antonio Argenziano <antonio.argenziano@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, igt-dev@lists.freedesktop.org
Cc: Petri Latvala <petri.latvala@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t 2/2] tests/i915/gem_fd_exhaustion.c: Expect ENFILE when fds run out
Date: Mon, 8 Apr 2019 16:06:35 -0700	[thread overview]
Message-ID: <94db7da0-21f4-b21d-8178-0b454445adcc@intel.com> (raw)
In-Reply-To: <155476443995.17365.16333654173903753945@skylake-alporthouse-com>



On 08/04/19 16:00, Chris Wilson wrote:
> Quoting Antonio Argenziano (2019-04-08 23:52:00)
>> Change the test to expect gem_create to return ENFILE when we run out of
>> fds.
>>
>> Cc: Chris Wilson <chris@chris-wilson.co.uk>
>> Cc: Petri Latvala <petri.latvala@intel.com>
>> Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com>
>> ---
>>   tests/i915/gem_fd_exhaustion.c | 11 ++++++-----
>>   1 file changed, 6 insertions(+), 5 deletions(-)
>>
>> diff --git a/tests/i915/gem_fd_exhaustion.c b/tests/i915/gem_fd_exhaustion.c
>> index 23602b98..83d0e926 100644
>> --- a/tests/i915/gem_fd_exhaustion.c
>> +++ b/tests/i915/gem_fd_exhaustion.c
>> @@ -48,15 +48,16 @@ igt_simple_main
>>                          int leak = open("/dev/null", O_RDONLY);
>>                          uint32_t handle;
>>   
>> -                       if (__gem_create(fd, 4096, &handle) == 0)
>> -                               gem_close(fd, handle);
>> -
>>                          if (leak < 0) {
>>                                  igt_info("fd exhaustion after %i rounds.\n", i);
>> -                               igt_assert(__gem_create(fd, 4096,
>> -                                                       &handle) < 0);
>> +                               igt_assert_eq(__gem_create(fd, 4096,
>> +                                                       &handle), -ENFILE);
> 
> It can also just fail by running out of memory, and memory says EMFILE.

ret = __gem_create();
ret == ENFILE || ret == EMFILE? Or is there something we could check 
beforehand so we know what to expect?

Antonio

> -Chris
> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2019-04-08 23:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-08 22:51 [igt-dev] [PATCH i-g-t 1/2] tests/i915/gem_fd_exhaustion.c: Remove unused sysfs functions Antonio Argenziano
2019-04-08 22:52 ` [igt-dev] [PATCH i-g-t 2/2] tests/i915/gem_fd_exhaustion.c: Expect ENFILE when fds run out Antonio Argenziano
2019-04-08 23:00   ` Chris Wilson
2019-04-08 23:06     ` Antonio Argenziano [this message]
2019-04-08 23:42       ` Chris Wilson
2019-04-08 23:53 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] tests/i915/gem_fd_exhaustion.c: Remove unused sysfs functions Patchwork
2019-04-09  6:31 ` [igt-dev] ✓ Fi.CI.IGT: " 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=94db7da0-21f4-b21d-8178-0b454445adcc@intel.com \
    --to=antonio.argenziano@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=petri.latvala@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