intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH i-g-t] lib: Keep upto half of RAM reserved for test runner
@ 2018-08-14 13:10 Chris Wilson
  0 siblings, 0 replies; only message in thread
From: Chris Wilson @ 2018-08-14 13:10 UTC (permalink / raw)
  To: igt-dev; +Cc: Tomi Sarvela, intel-gfx

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

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-08-14 13:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-14 13:10 [PATCH i-g-t] lib: Keep upto half of RAM reserved for test runner Chris Wilson

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).