From 30e501adedf2c89839ef1d654a0281155cfbc589 Mon Sep 17 00:00:00 2001 From: Michał Winiarski Date: Mon, 11 Jun 2018 17:31:11 +0200 Subject: lib: Extract mlock probing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We already have the routine we need in drv_suspend. Let's move it to lib and use it in the mlocking tests. We can also make it a bit faster if we tweak the initial step and initial amount. (I think it's safe to assume that we should be able to lock 3/4 of RAM, this cuts the probe time on my 32G SKL - from ~530s to ~180s) v2: Use available mem, amend step, also lock outside of fork, early exit if the assumption is wrong (Chris) Update the function name in doc (Ewelina) v3: Total for pin, available for initial lock (Chris) Signed-off-by: Michał Winiarski Cc: Chris Wilson Cc: Ewelina Musial Reviewed-by: Chris Wilson Reviewed-by: Ewelina Musial --- lib/igt_aux.h | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/igt_aux.h') diff --git a/lib/igt_aux.h b/lib/igt_aux.h index 0eb96e44..9a962881 100644 --- a/lib/igt_aux.h +++ b/lib/igt_aux.h @@ -209,6 +209,7 @@ void intel_purge_vm_caches(int fd); uint64_t intel_get_avail_ram_mb(void); uint64_t intel_get_total_ram_mb(void); uint64_t intel_get_total_swap_mb(void); +size_t intel_get_total_pinnable_mem(void); int __intel_check_memory(uint64_t count, uint64_t size, unsigned mode, uint64_t *out_required, uint64_t *out_total); -- cgit v1.2.3