public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: "Chris Wilson" <chris@chris-wilson.co.uk>,
	"Michał Winiarski" <michal.winiarski@intel.com>
Cc: igt-dev@lists.freedesktop.org, Intel-gfx@lists.freedesktop.org,
	Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t] tests/gem_shrink: Exercise OOM and other routes to shrinking in reasonable time
Date: Mon, 7 Jan 2019 12:52:28 +0000	[thread overview]
Message-ID: <28fb5705-9168-7a9f-c3d8-985c6fa63fa7@linux.intel.com> (raw)
In-Reply-To: <154686430699.27300.2976914925466135969@skylake-alporthouse-com>


On 07/01/2019 12:31, Chris Wilson wrote:
> Quoting Michał Winiarski (2019-01-07 12:27:07)
>> On Fri, Jan 04, 2019 at 03:37:09PM +0000, Tvrtko Ursulin wrote:
>>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>>
>>> A set of subtests which exercises different paths to our shrinker code
>>> (including the OOM killer) in predictable and reasonable time budget.
>>>
>>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>> ---
>>>   lib/igt_core.c                        |  19 ++
>>>   lib/igt_core.h                        |   1 +
>>>   tests/i915/gem_shrink.c               | 399 ++++++++++++++++++++++++++
>>>   tests/intel-ci/blacklist.txt          |   1 +
>>>   tests/intel-ci/fast-feedback.testlist |   3 +
>>>   5 files changed, 423 insertions(+)
>>
>> [snip]
>>
>>> diff --git a/tests/i915/gem_shrink.c b/tests/i915/gem_shrink.c
>>> index c8e05814ee70..7c002de0ef1f 100644
>>> --- a/tests/i915/gem_shrink.c
>>> +++ b/tests/i915/gem_shrink.c
>>> @@ -26,6 +26,10 @@
>>>    *
>>>    * Exercise the shrinker by overallocating GEM objects
>>>    */
>>> +#include <sys/types.h>
>>> +#include <sys/stat.h>
>>> +#include <sys/wait.h>
>>> +#include <fcntl.h>
>>>   
>>>   #include "igt.h"
>>>   #include "igt_gt.h"
>>> @@ -366,6 +370,376 @@ static void reclaim(unsigned engine, int timeout)
>>>        close(fd);
>>>   }
>>>   
>>> +static unsigned long get_meminfo(const char *info, const char *tag)
>>> +{
>>> +     const char *str;
>>> +     unsigned long val;
>>> +
>>> +     str = strstr(info, tag);
>>> +     if (str && sscanf(str + strlen(tag), " %lu", &val) == 1)
>>> +             return val >> 10;
>>> +
>>> +     igt_warn("Unrecognised /proc/meminfo field: '%s'\n", tag);
>>> +     return 0;
>>> +}
>>> +
>>> +static unsigned long get_avail_ram_mb(void)
>>> +{
>>> +     int fd;
>>> +     int ret;
>>> +     char buf[4096];
>>> +     unsigned long ram;
>>> +
>>> +     fd = open("/proc/meminfo", O_RDONLY);
>>> +     igt_assert_fd(fd);
>>> +
>>> +     ret = read(fd, buf, sizeof(buf));
>>> +     igt_assert(ret >= 0);
>>> +
>>> +     close(fd);
>>> +
>>> +     ram = get_meminfo(buf, "MemAvailable:");
>>> +     ram += get_meminfo(buf, "Buffers:");
>>> +     ram += get_meminfo(buf, "Cached:");
>>> +     ram += get_meminfo(buf, "SwapCached:");
>>> +
>>> +     return ram;
>>> +}
>>
>> What's wrong with ones from intel_os.c?
> 
> They pull in both an i915 and mm purge, which iirc, had to be avoided
> here.

Yep. I can sense a suggestion of adding a lighter weight version to the 
library now.. :)

Regards,

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

  reply	other threads:[~2019-01-07 12:52 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-04 15:37 [Intel-gfx] [PATCH i-g-t] tests/gem_shrink: Exercise OOM and other routes to shrinking in reasonable time Tvrtko Ursulin
2019-01-04 16:05 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-01-04 16:57 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-01-07 11:01 ` [igt-dev] [PATCH i-g-t] " Petri Latvala
2019-01-07 11:12   ` Tvrtko Ursulin
2019-01-07 11:28     ` Petri Latvala
2019-01-07 17:33       ` Tvrtko Ursulin
2019-01-07 12:27 ` Michał Winiarski
2019-01-07 12:31   ` Chris Wilson
2019-01-07 12:52     ` Tvrtko Ursulin [this message]
2019-01-07 12:56       ` Chris Wilson
2019-01-07 17:36 ` [igt-dev] [PATCH i-g-t v2] " Tvrtko Ursulin
2019-01-07 18:22   ` [igt-dev] [PATCH i-g-t v3] " Tvrtko Ursulin
2019-01-08 10:57     ` [igt-dev] [Intel-gfx] " Chris Wilson
2019-01-07 18:00 ` [igt-dev] ✗ Fi.CI.BAT: failure for tests/gem_shrink: Exercise OOM and other routes to shrinking in reasonable time (rev2) Patchwork
2019-01-07 18:25   ` Tvrtko Ursulin
2019-01-07 20:53     ` Chris Wilson
2019-01-07 21:43       ` Chris Wilson
2019-01-07 19:24 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/gem_shrink: Exercise OOM and other routes to shrinking in reasonable time (rev3) Patchwork
2019-01-07 22:15 ` [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=28fb5705-9168-7a9f-c3d8-985c6fa63fa7@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=chris@chris-wilson.co.uk \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=michal.winiarski@intel.com \
    --cc=tvrtko.ursulin@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