summaryrefslogtreecommitdiff
path: root/lib/igt_core.c
diff options
context:
space:
mode:
authorArkadiusz Hiler <arkadiusz.hiler@intel.com>2017-11-24 17:17:47 +0200
committerArkadiusz Hiler <arkadiusz.hiler@intel.com>2017-11-29 15:09:25 +0200
commit430946d0b8814dd755c29adb0b38b55c4703d072 (patch)
treefe2497b65427bc4ad3799abe176040feb6b22436 /lib/igt_core.c
parent380cc811486ba3fefbe3ebe4761afa7e169dcd3e (diff)
igt: Remove Android support
This patch gets rid of the Android support, deleting all the hacks and moving code around to the places it belongs. Android build is not really maintained properly and rots rather fast. With recent push for Meson here and Android going for Soong it will only accelerate. It's a good time to drop the illusion of providing any support. Cc: Daniel Vetter <daniel.vetter@intel.com> Cc: Kalyan Kondapally <kalyan.kondapally@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Cc: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Acked-by: Petri Latvala <petri.latvala@intel.com>
Diffstat (limited to 'lib/igt_core.c')
-rw-r--r--lib/igt_core.c68
1 files changed, 0 insertions, 68 deletions
diff --git a/lib/igt_core.c b/lib/igt_core.c
index 6ce83bec..de9269b0 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -496,72 +496,6 @@ void __igt_fixture_end(void)
}
/*
- * Some of the IGT tests put quite a lot of pressure on memory and when
- * running on Android they are sometimes killed by the Android low memory killer.
- * This seems to be due to some incompatibility between the kswapd free memory
- * targets and the way the lowmemorykiller assesses free memory.
- * The low memory killer really isn't usefull in this context and has no
- * interaction with the gpu driver that we are testing, so the following
- * function is used to disable it by modifying one of its module parameters.
- * We still have the normal linux oom killer to protect the kernel.
- * Apparently it is also possible for the lowmemorykiller to get included
- * in some linux distributions; so rather than check for Android we directly
- * check for the existence of the module parameter we want to adjust.
- *
- * In future, if we can get the lowmemorykiller to play nicely then we can
- * remove this hack.
- */
-static void low_mem_killer_disable(bool disable)
-{
- static const char* adj_fname="/sys/module/lowmemorykiller/parameters/adj";
- static const char no_lowmem_killer[] = "9999";
- int fd;
- struct stat buf;
- /* The following must persist across invocations */
- static char prev_adj_scores[256];
- static int adj_scores_len = 0;
- static bool is_disabled = false;
-
- /* capture the permissions bits for the lowmemkiller adj pseudo-file.
- * Bail out if the stat fails; it probably means that there is no
- * lowmemorykiller, but in any case we're doomed. */
- if (stat(adj_fname, &buf)) {
- igt_assert(errno == ENOENT);
- return;
- }
-
- /* make sure the file can be read/written - by default it is write-only */
- chmod(adj_fname, S_IRUSR | S_IWUSR);
-
- if (disable && !is_disabled) {
- /* read the current oom adj parameters for lowmemorykiller */
- fd = open(adj_fname, O_RDWR);
- igt_assert(fd != -1);
- adj_scores_len = read(fd, (void*)prev_adj_scores, 255);
- igt_assert(adj_scores_len > 0);
-
- /* writing 9999 to this module parameter effectively diables the
- * low memory killer. This is not a real file, so we dont need to
- * seek to the start or truncate it */
- igt_assert_eq(write(fd, no_lowmem_killer, sizeof(no_lowmem_killer)),
- sizeof(no_lowmem_killer));
- close(fd);
- is_disabled = true;
- } else if (is_disabled) {
- /* just re-enstate the original settings */
- fd = open(adj_fname, O_WRONLY);
- igt_assert(fd != -1);
- igt_assert_eq(write(fd, prev_adj_scores, adj_scores_len),
- adj_scores_len);
- close(fd);
- is_disabled = false;
- }
-
- /* re-enstate the file permissions */
- chmod(adj_fname, buf.st_mode);
-}
-
-/*
* If the test takes out the machine, in addition to the usual dmesg
* spam, the kernel may also emit a "death rattle" -- extra debug
* information that is overkill for normal successful tests, but
@@ -587,7 +521,6 @@ bool igt_exit_called;
static void common_exit_handler(int sig)
{
if (!igt_only_list_subtests()) {
- low_mem_killer_disable(false);
kick_fbcon(true);
}
@@ -879,7 +812,6 @@ out:
sync();
oom_adjust_for_doom();
- low_mem_killer_disable(true);
ftrace_dump_on_oops(true);
}