From: Chris Wilson <chris@chris-wilson.co.uk>
To: igt-dev@lists.freedesktop.org
Cc: Tomi Sarvela <tomi.p.sarvela@intel.com>, intel-gfx@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t] lib: Keep upto half of RAM reserved for test runner
Date: Tue, 14 Aug 2018 14:10:36 +0100 [thread overview]
Message-ID: <20180814131036.9447-1-chris@chris-wilson.co.uk> (raw)
Halve our estimated available RAM for use by the tests to avoid nasty
situations where the test runner may force us into swap.
Rumour has it that the new runner isn't quite so bloated as piglit...
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tomi Sarvela <tomi.p.sarvela@intel.com>
Cc: Petri Latvala <petri.latvala@intel.com>
---
lib/intel_os.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/lib/intel_os.c b/lib/intel_os.c
index 29a27272e..4037440fd 100644
--- a/lib/intel_os.c
+++ b/lib/intel_os.c
@@ -329,8 +329,11 @@ int __intel_check_memory(uint64_t count, uint64_t size, unsigned mode,
mode & CHECK_SWAP ? " + swap": "");
total = 0;
- if (mode & (CHECK_RAM | CHECK_SWAP))
- total += intel_get_avail_ram_mb();
+ if (mode & (CHECK_RAM | CHECK_SWAP)) {
+ total = intel_get_avail_ram_mb();
+ /* Keep some in reserve for the runner. */
+ total -= min(total / 2, 1000);
+ }
if (mode & CHECK_SWAP)
total += intel_get_total_swap_mb();
total *= 1024 * 1024;
--
2.18.0
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next reply other threads:[~2018-08-14 13:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-14 13:10 Chris Wilson [this message]
2018-08-14 14:26 ` [igt-dev] ✓ Fi.CI.BAT: success for lib: Keep upto half of RAM reserved for test runner Patchwork
2018-08-14 18:58 ` [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=20180814131036.9447-1-chris@chris-wilson.co.uk \
--to=chris@chris-wilson.co.uk \
--cc=igt-dev@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=tomi.p.sarvela@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;
as well as URLs for NNTP newsgroup(s).