All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH 1/4] lib/igt_kmod: simplify check for loaded module
@ 2019-04-04 22:39 Lucas De Marchi
  2019-04-04 22:39 ` [igt-dev] [PATCH 2/4] gem_exec_parallel: do not special case the default Lucas De Marchi
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Lucas De Marchi @ 2019-04-04 22:39 UTC (permalink / raw)
  To: igt-dev; +Cc: Lucas De Marchi

No need to go through the list of loaded modules and check one by one.
We can just check if it's in "live" state or if it's builtin.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
 lib/igt_kmod.c | 19 ++++++-------------
 1 file changed, 6 insertions(+), 13 deletions(-)

diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c
index 91662eb3..8d5ac788 100644
--- a/lib/igt_kmod.c
+++ b/lib/igt_kmod.c
@@ -119,25 +119,18 @@ bool
 igt_kmod_is_loaded(const char *mod_name)
 {
 	struct kmod_ctx *ctx = kmod_ctx();
-	struct kmod_list *mod, *list;
+	enum kmod_module_initstate state;
+	struct kmod_module *kmod;
 	bool ret = false;
 
-	if (kmod_module_new_from_loaded(ctx, &list) < 0)
+	if (kmod_module_new_from_name(ctx, mod_name, &kmod) < 0)
 		goto out;
 
-	kmod_list_foreach(mod, list) {
-		struct kmod_module *kmod = kmod_module_get_module(mod);
-		const char *kmod_name = kmod_module_get_name(kmod);
+	state = kmod_module_get_initstate(kmod);
+	ret = state == KMOD_MODULE_LIVE || state == KMOD_MODULE_BUILTIN;
 
-		if (!strcmp(kmod_name, mod_name)) {
-			kmod_module_unref(kmod);
-			ret = true;
-			break;
-		}
-		kmod_module_unref(kmod);
-	}
-	kmod_module_unref_list(list);
 out:
+	kmod_module_unref(kmod);
 	return ret;
 }
 
-- 
2.21.0

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

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [igt-dev] [PATCH 2/4] gem_exec_parallel: do not special case the default
  2019-04-04 22:39 [igt-dev] [PATCH 1/4] lib/igt_kmod: simplify check for loaded module Lucas De Marchi
@ 2019-04-04 22:39 ` Lucas De Marchi
  2019-04-04 22:57   ` Chris Wilson
  2019-04-04 22:39 ` [igt-dev] [PATCH 3/4] lib: add igt_allow_unlimited_files() Lucas De Marchi
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Lucas De Marchi @ 2019-04-04 22:39 UTC (permalink / raw)
  To: igt-dev; +Cc: Lucas De Marchi

A default makes sense when it's the most used.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
 tests/i915/gem_exec_parallel.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/i915/gem_exec_parallel.c b/tests/i915/gem_exec_parallel.c
index a6fa698e..f8320c3a 100644
--- a/tests/i915/gem_exec_parallel.c
+++ b/tests/i915/gem_exec_parallel.c
@@ -231,7 +231,7 @@ igt_main
 		const char *name;
 		unsigned flags;
 	} modes[] = {
-		{ "", 0 },
+		{ "basic", 0 },
 		{ "contexts", CONTEXTS },
 		{ "fds", FDS },
 		{ NULL }
@@ -246,7 +246,7 @@ igt_main
 	}
 
 	for (const struct mode *m = modes; m->name; m++)
-		igt_subtest_f("%s", *m->name ? m->name : "basic")
+		igt_subtest_f("%s", m->name)
 			all(fd, ALL_ENGINES, m->flags);
 
 	for (const struct intel_execution_engine *e = intel_execution_engines;
-- 
2.21.0

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

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [igt-dev] [PATCH 3/4] lib: add igt_allow_unlimited_files()
  2019-04-04 22:39 [igt-dev] [PATCH 1/4] lib/igt_kmod: simplify check for loaded module Lucas De Marchi
  2019-04-04 22:39 ` [igt-dev] [PATCH 2/4] gem_exec_parallel: do not special case the default Lucas De Marchi
@ 2019-04-04 22:39 ` Lucas De Marchi
  2019-04-04 23:00   ` Chris Wilson
  2019-04-04 22:39 ` [igt-dev] [PATCH 4/4] gem_exec_parallel: allow unlimited open files Lucas De Marchi
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Lucas De Marchi @ 2019-04-04 22:39 UTC (permalink / raw)
  To: igt-dev; +Cc: Lucas De Marchi

Share the implementation to tweak the maximum number of open files.
The version in tests/i915/gem_exec_reuse.c was a little bit different,
but I don't think it needs to be because it would still return a
failure if any of the calls to setrlimit() fail. So I'm using the other
one.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
 lib/igt_aux.c                   | 21 +++++++++++++++++++++
 lib/igt_aux.h                   |  2 ++
 tests/i915/gem_concurrent_all.c | 22 +---------------------
 tests/i915/gem_exec_reuse.c     | 25 +------------------------
 tests/i915/gem_fd_exhaustion.c  | 22 +---------------------
 5 files changed, 26 insertions(+), 66 deletions(-)

diff --git a/lib/igt_aux.c b/lib/igt_aux.c
index 6eaf546e..266aa832 100644
--- a/lib/igt_aux.c
+++ b/lib/igt_aux.c
@@ -42,6 +42,7 @@
 #include <unistd.h>
 #include <sys/poll.h>
 #include <sys/wait.h>
+#include <sys/resource.h>
 #include <sys/time.h>
 #include <sys/types.h>
 #include <sys/syscall.h>
@@ -1588,3 +1589,23 @@ double igt_stop_siglatency(struct igt_mean *result)
 
 	return mean;
 }
+
+bool igt_allow_unlimited_files(void)
+{
+	struct rlimit rlim;
+	unsigned nofile_rlim = 1024*1024;
+
+	FILE *file = fopen("/proc/sys/fs/file-max", "r");
+	if (file) {
+		igt_assert(fscanf(file, "%u", &nofile_rlim) == 1);
+		igt_info("System limit for open files is %u\n", nofile_rlim);
+		fclose(file);
+	}
+
+	if (getrlimit(RLIMIT_NOFILE, &rlim))
+		return false;
+
+	rlim.rlim_cur = nofile_rlim;
+	rlim.rlim_max = nofile_rlim;
+	return setrlimit(RLIMIT_NOFILE, &rlim) == 0;
+}
diff --git a/lib/igt_aux.h b/lib/igt_aux.h
index 09b6246b..55392790 100644
--- a/lib/igt_aux.h
+++ b/lib/igt_aux.h
@@ -274,6 +274,8 @@ struct igt_mean;
 void igt_start_siglatency(int sig); /* 0 => SIGRTMIN (default) */
 double igt_stop_siglatency(struct igt_mean *result);
 
+bool igt_allow_unlimited_files(void);
+
 void igt_set_module_param(const char *name, const char *val);
 void igt_set_module_param_int(const char *name, int val);
 
diff --git a/tests/i915/gem_concurrent_all.c b/tests/i915/gem_concurrent_all.c
index 6049372d..3ddaab82 100644
--- a/tests/i915/gem_concurrent_all.c
+++ b/tests/i915/gem_concurrent_all.c
@@ -1678,26 +1678,6 @@ num_buffers(uint64_t max,
 	return n;
 }
 
-static bool allow_unlimited_files(void)
-{
-	struct rlimit rlim;
-	unsigned nofile_rlim = 1024*1024;
-
-	FILE *file = fopen("/proc/sys/fs/file-max", "r");
-	if (file) {
-		igt_assert(fscanf(file, "%u", &nofile_rlim) == 1);
-		igt_info("System limit for open files is %u\n", nofile_rlim);
-		fclose(file);
-	}
-
-	if (getrlimit(RLIMIT_NOFILE, &rlim))
-		return false;
-
-	rlim.rlim_cur = nofile_rlim;
-	rlim.rlim_max = nofile_rlim;
-	return setrlimit(RLIMIT_NOFILE, &rlim) == 0;
-}
-
 igt_main
 {
 	const struct access_mode modes[] = {
@@ -1821,7 +1801,7 @@ igt_main
 		all = true;
 
 	igt_fixture {
-		allow_unlimited_files();
+		igt_allow_unlimited_files();
 
 		fd = drm_open_driver(DRIVER_INTEL);
 		igt_require_gem(fd);
diff --git a/tests/i915/gem_exec_reuse.c b/tests/i915/gem_exec_reuse.c
index 55904718..9cba1354 100644
--- a/tests/i915/gem_exec_reuse.c
+++ b/tests/i915/gem_exec_reuse.c
@@ -56,29 +56,6 @@ static void noop(struct noop *n,
 	gem_execbuf(n->fd, &execbuf);
 }
 
-static bool allow_unlimited_files(void)
-{
-	struct rlimit rlim;
-	unsigned nofile_rlim = 1024*1024;
-
-	FILE *file = fopen("/proc/sys/fs/file-max", "r");
-	if (file) {
-		igt_assert(fscanf(file, "%u", &nofile_rlim) == 1);
-		fclose(file);
-	}
-
-	if (getrlimit(RLIMIT_NOFILE, &rlim))
-		return false;
-
-	rlim.rlim_cur = rlim.rlim_max;
-	if (setrlimit(RLIMIT_NOFILE, &rlim))
-		return false;
-
-	rlim.rlim_cur = nofile_rlim;
-	rlim.rlim_max = nofile_rlim;
-	return setrlimit(RLIMIT_NOFILE, &rlim) == 0;
-}
-
 static uint64_t vfs_file_max(void)
 {
 	long long unsigned max = 80000;
@@ -126,7 +103,7 @@ igt_main
 		uint32_t bbe = MI_BATCH_BUFFER_END;
 		unsigned engine;
 
-		allow_unlimited_files();
+		igt_allow_unlimited_files();
 
 		no.fd = drm_open_driver(DRIVER_INTEL);
 		igt_require_gem(no.fd);
diff --git a/tests/i915/gem_fd_exhaustion.c b/tests/i915/gem_fd_exhaustion.c
index 559590b1..9704fa02 100644
--- a/tests/i915/gem_fd_exhaustion.c
+++ b/tests/i915/gem_fd_exhaustion.c
@@ -60,26 +60,6 @@ static int write_sysctl(const char *path, unsigned int val)
 	return -errno;
 }
 
-static bool allow_unlimited_files(void)
-{
-	unsigned int nofile_rlim = 1024*1024;
-	struct rlimit rlim;
-	unsigned int buf;
-
-	buf = read_sysctl("/proc/sys/fs/file-max");
-	if (buf > 0)
-		nofile_rlim = buf;
-	original_nr_open = read_sysctl("/proc/sys/fs/nr_open");
-	igt_assert(write_sysctl("/proc/sys/fs/nr_open", nofile_rlim) == 0);
-
-	if (getrlimit(RLIMIT_NOFILE, &rlim))
-		return false;
-
-	rlim.rlim_cur = nofile_rlim;
-	rlim.rlim_max = nofile_rlim;
-	return setrlimit(RLIMIT_NOFILE, &rlim) == 0;
-}
-
 static void restore_original_sysctl(int sig)
 {
 	if (original_nr_open > 0)
@@ -90,7 +70,7 @@ igt_simple_main
 {
 	int fd;
 
-	igt_require(allow_unlimited_files());
+	igt_require(igt_allow_unlimited_files());
 
 	fd = drm_open_driver(DRIVER_INTEL);
 
-- 
2.21.0

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

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [igt-dev] [PATCH 4/4] gem_exec_parallel: allow unlimited open files
  2019-04-04 22:39 [igt-dev] [PATCH 1/4] lib/igt_kmod: simplify check for loaded module Lucas De Marchi
  2019-04-04 22:39 ` [igt-dev] [PATCH 2/4] gem_exec_parallel: do not special case the default Lucas De Marchi
  2019-04-04 22:39 ` [igt-dev] [PATCH 3/4] lib: add igt_allow_unlimited_files() Lucas De Marchi
@ 2019-04-04 22:39 ` Lucas De Marchi
  2019-04-04 23:01   ` Chris Wilson
  2019-04-04 23:19 ` [igt-dev] [PATCH 1/4] lib/igt_kmod: simplify check for loaded module Chris Wilson
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Lucas De Marchi @ 2019-04-04 22:39 UTC (permalink / raw)
  To: igt-dev; +Cc: Lucas De Marchi

I was looking into a failure in which I had

libkmod: ERROR ../libkmod/libkmod-config.c:790 conf_files_list: opendir(/etc/modprobe.d): Too many open files
libkmod: ERROR ../libkmod/libkmod-config.c:790 conf_files_list: opendir(/lib/modprobe.d): Too many open files
(gem_exec_parallel:1315) igt_kmod-WARNING: Could not load i915
(gem_exec_parallel:1315) igt_kmod-WARNING: Could not load i915

I got curious because libkmod doesn't open more than one config file at
a time. What's happening is that libkmod is not the culprit, it's just
the one that failed because we open /dev/dri/card0 -ETOOMANYTIMES.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
 tests/i915/gem_exec_parallel.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/i915/gem_exec_parallel.c b/tests/i915/gem_exec_parallel.c
index f8320c3a..54209455 100644
--- a/tests/i915/gem_exec_parallel.c
+++ b/tests/i915/gem_exec_parallel.c
@@ -164,8 +164,10 @@ static void all(int fd, unsigned engine, unsigned flags)
 	if (flags & CONTEXTS)
 		gem_require_contexts(fd);
 
-	if (flags & FDS)
+	if (flags & FDS) {
 		igt_require(gen > 5);
+		igt_require(igt_allow_unlimited_files());
+	}
 
 	nengine = 0;
 	if (engine == ALL_ENGINES) {
-- 
2.21.0

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

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [igt-dev] [PATCH 2/4] gem_exec_parallel: do not special case the default
  2019-04-04 22:39 ` [igt-dev] [PATCH 2/4] gem_exec_parallel: do not special case the default Lucas De Marchi
@ 2019-04-04 22:57   ` Chris Wilson
  0 siblings, 0 replies; 13+ messages in thread
From: Chris Wilson @ 2019-04-04 22:57 UTC (permalink / raw)
  To: Lucas De Marchi, igt-dev; +Cc: Lucas De Marchi

Quoting Lucas De Marchi (2019-04-04 23:39:23)
> A default makes sense when it's the most used.

It's not the most used name...
 
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
> ---
>  tests/i915/gem_exec_parallel.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/i915/gem_exec_parallel.c b/tests/i915/gem_exec_parallel.c
> index a6fa698e..f8320c3a 100644
> --- a/tests/i915/gem_exec_parallel.c
> +++ b/tests/i915/gem_exec_parallel.c
> @@ -231,7 +231,7 @@ igt_main
>                 const char *name;
>                 unsigned flags;
>         } modes[] = {
> -               { "", 0 },
> +               { "basic", 0 },
>                 { "contexts", CONTEXTS },
>                 { "fds", FDS },
>                 { NULL }
> @@ -246,7 +246,7 @@ igt_main
>         }
>  
>         for (const struct mode *m = modes; m->name; m++)
> -               igt_subtest_f("%s", *m->name ? m->name : "basic")
> +               igt_subtest_f("%s", m->name)
>                         all(fd, ALL_ENGINES, m->flags);

It gets used again where basic should not be added.
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [igt-dev] [PATCH 3/4] lib: add igt_allow_unlimited_files()
  2019-04-04 22:39 ` [igt-dev] [PATCH 3/4] lib: add igt_allow_unlimited_files() Lucas De Marchi
@ 2019-04-04 23:00   ` Chris Wilson
  0 siblings, 0 replies; 13+ messages in thread
From: Chris Wilson @ 2019-04-04 23:00 UTC (permalink / raw)
  To: Lucas De Marchi, igt-dev; +Cc: Lucas De Marchi

Quoting Lucas De Marchi (2019-04-04 23:39:24)
> Share the implementation to tweak the maximum number of open files.
> The version in tests/i915/gem_exec_reuse.c was a little bit different,
> but I don't think it needs to be because it would still return a
> failure if any of the calls to setrlimit() fail. So I'm using the other
> one.
> 
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>

That's more or less a simple translation.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [igt-dev] [PATCH 4/4] gem_exec_parallel: allow unlimited open files
  2019-04-04 22:39 ` [igt-dev] [PATCH 4/4] gem_exec_parallel: allow unlimited open files Lucas De Marchi
@ 2019-04-04 23:01   ` Chris Wilson
  0 siblings, 0 replies; 13+ messages in thread
From: Chris Wilson @ 2019-04-04 23:01 UTC (permalink / raw)
  To: Lucas De Marchi, igt-dev; +Cc: Lucas De Marchi

Quoting Lucas De Marchi (2019-04-04 23:39:25)
> I was looking into a failure in which I had
> 
> libkmod: ERROR ../libkmod/libkmod-config.c:790 conf_files_list: opendir(/etc/modprobe.d): Too many open files
> libkmod: ERROR ../libkmod/libkmod-config.c:790 conf_files_list: opendir(/lib/modprobe.d): Too many open files
> (gem_exec_parallel:1315) igt_kmod-WARNING: Could not load i915
> (gem_exec_parallel:1315) igt_kmod-WARNING: Could not load i915
> 
> I got curious because libkmod doesn't open more than one config file at
> a time. What's happening is that libkmod is not the culprit, it's just
> the one that failed because we open /dev/dri/card0 -ETOOMANYTIMES.
> 
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [igt-dev] [PATCH 1/4] lib/igt_kmod: simplify check for loaded module
  2019-04-04 22:39 [igt-dev] [PATCH 1/4] lib/igt_kmod: simplify check for loaded module Lucas De Marchi
                   ` (2 preceding siblings ...)
  2019-04-04 22:39 ` [igt-dev] [PATCH 4/4] gem_exec_parallel: allow unlimited open files Lucas De Marchi
@ 2019-04-04 23:19 ` Chris Wilson
  2019-04-05 16:33   ` Lucas De Marchi
  2019-04-04 23:39 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [1/4] " Patchwork
  2019-04-05 19:29 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  5 siblings, 1 reply; 13+ messages in thread
From: Chris Wilson @ 2019-04-04 23:19 UTC (permalink / raw)
  To: Lucas De Marchi, igt-dev; +Cc: Lucas De Marchi

Quoting Lucas De Marchi (2019-04-04 23:39:22)
> No need to go through the list of loaded modules and check one by one.
> We can just check if it's in "live" state or if it's builtin.
> 
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
> ---
>  lib/igt_kmod.c | 19 ++++++-------------
>  1 file changed, 6 insertions(+), 13 deletions(-)
> 
> diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c
> index 91662eb3..8d5ac788 100644
> --- a/lib/igt_kmod.c
> +++ b/lib/igt_kmod.c
> @@ -119,25 +119,18 @@ bool
>  igt_kmod_is_loaded(const char *mod_name)
>  {
>         struct kmod_ctx *ctx = kmod_ctx();
> -       struct kmod_list *mod, *list;
> +       enum kmod_module_initstate state;
> +       struct kmod_module *kmod;
>         bool ret = false;
>  
> -       if (kmod_module_new_from_loaded(ctx, &list) < 0)
> +       if (kmod_module_new_from_name(ctx, mod_name, &kmod) < 0)
>                 goto out;
>  
> -       kmod_list_foreach(mod, list) {
> -               struct kmod_module *kmod = kmod_module_get_module(mod);
> -               const char *kmod_name = kmod_module_get_name(kmod);
> +       state = kmod_module_get_initstate(kmod);
> +       ret = state == KMOD_MODULE_LIVE || state == KMOD_MODULE_BUILTIN;

So if the module is being loaded, it is also present. If the module is
being unloaded it is currently present and we need to wait.

Looks like this should be ret = state >= 0 ? If the module is any of
LIVE/BUILTIN/COMING/GOING it is presently loaded.
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [igt-dev] ✓ Fi.CI.BAT: success for series starting with [1/4] lib/igt_kmod: simplify check for loaded module
  2019-04-04 22:39 [igt-dev] [PATCH 1/4] lib/igt_kmod: simplify check for loaded module Lucas De Marchi
                   ` (3 preceding siblings ...)
  2019-04-04 23:19 ` [igt-dev] [PATCH 1/4] lib/igt_kmod: simplify check for loaded module Chris Wilson
@ 2019-04-04 23:39 ` Patchwork
  2019-04-05 19:29 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  5 siblings, 0 replies; 13+ messages in thread
From: Patchwork @ 2019-04-04 23:39 UTC (permalink / raw)
  To: Lucas De Marchi; +Cc: igt-dev

== Series Details ==

Series: series starting with [1/4] lib/igt_kmod: simplify check for loaded module
URL   : https://patchwork.freedesktop.org/series/59026/
State : success

== Summary ==

CI Bug Log - changes from IGT_4929 -> IGTPW_2791
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/59026/revisions/1/mbox/

Known issues
------------

  Here are the changes found in IGTPW_2791 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@amdgpu/amd_cs_nop@fork-compute0:
    - fi-icl-y:           NOTRUN -> SKIP [fdo#109315] +17

  * igt@i915_selftest@live_contexts:
    - fi-icl-y:           NOTRUN -> DMESG-FAIL [fdo#108569]

  * igt@kms_pipe_crc_basic@hang-read-crc-pipe-a:
    - fi-byt-clapper:     PASS -> FAIL [fdo#103191] / [fdo#107362]

  * igt@kms_pipe_crc_basic@nonblocking-crc-pipe-b:
    - fi-byt-clapper:     PASS -> FAIL [fdo#107362]

  
#### Possible fixes ####

  * igt@gem_tiled_blits@basic:
    - fi-icl-y:           FAIL -> PASS

  * igt@i915_module_load@reload-with-fault-injection:
    - fi-icl-y:           INCOMPLETE [fdo#107713] -> PASS

  * igt@kms_frontbuffer_tracking@basic:
    - fi-byt-clapper:     FAIL [fdo#103167] -> PASS

  * igt@kms_pipe_crc_basic@read-crc-pipe-a-frame-sequence:
    - fi-byt-clapper:     FAIL [fdo#103191] / [fdo#107362] -> PASS

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
  [fdo#107362]: https://bugs.freedesktop.org/show_bug.cgi?id=107362
  [fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
  [fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
  [fdo#109315]: https://bugs.freedesktop.org/show_bug.cgi?id=109315


Participating hosts (49 -> 43)
------------------------------

  Missing    (6): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-kbl-8809g 


Build changes
-------------

    * IGT: IGT_4929 -> IGTPW_2791

  CI_DRM_5875: 5cc7c47c44aaef5bfe07e7307d06caa98e401fad @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_2791: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2791/
  IGT_4929: 8770e24fe4008404da769c16b7edac6142225ad7 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools



== Testlist changes ==

+igt@gem_exec_parallel@blt-basic
+igt@gem_exec_parallel@bsd1-basic
+igt@gem_exec_parallel@bsd2-basic
+igt@gem_exec_parallel@bsd-basic
+igt@gem_exec_parallel@default-basic
+igt@gem_exec_parallel@render-basic
+igt@gem_exec_parallel@vebox-basic
-igt@gem_exec_parallel@blt
-igt@gem_exec_parallel@bsd
-igt@gem_exec_parallel@bsd1
-igt@gem_exec_parallel@bsd2
-igt@gem_exec_parallel@default
-igt@gem_exec_parallel@render
-igt@gem_exec_parallel@vebox

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2791/
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [igt-dev] [PATCH 1/4] lib/igt_kmod: simplify check for loaded module
  2019-04-04 23:19 ` [igt-dev] [PATCH 1/4] lib/igt_kmod: simplify check for loaded module Chris Wilson
@ 2019-04-05 16:33   ` Lucas De Marchi
  0 siblings, 0 replies; 13+ messages in thread
From: Lucas De Marchi @ 2019-04-05 16:33 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev

On Fri, Apr 05, 2019 at 12:19:35AM +0100, Chris Wilson wrote:
>Quoting Lucas De Marchi (2019-04-04 23:39:22)
>> No need to go through the list of loaded modules and check one by one.
>> We can just check if it's in "live" state or if it's builtin.
>>
>> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
>> ---
>>  lib/igt_kmod.c | 19 ++++++-------------
>>  1 file changed, 6 insertions(+), 13 deletions(-)
>>
>> diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c
>> index 91662eb3..8d5ac788 100644
>> --- a/lib/igt_kmod.c
>> +++ b/lib/igt_kmod.c
>> @@ -119,25 +119,18 @@ bool
>>  igt_kmod_is_loaded(const char *mod_name)
>>  {
>>         struct kmod_ctx *ctx = kmod_ctx();
>> -       struct kmod_list *mod, *list;
>> +       enum kmod_module_initstate state;
>> +       struct kmod_module *kmod;
>>         bool ret = false;
>>
>> -       if (kmod_module_new_from_loaded(ctx, &list) < 0)
>> +       if (kmod_module_new_from_name(ctx, mod_name, &kmod) < 0)
>>                 goto out;
>>
>> -       kmod_list_foreach(mod, list) {
>> -               struct kmod_module *kmod = kmod_module_get_module(mod);
>> -               const char *kmod_name = kmod_module_get_name(kmod);
>> +       state = kmod_module_get_initstate(kmod);
>> +       ret = state == KMOD_MODULE_LIVE || state == KMOD_MODULE_BUILTIN;
>
>So if the module is being loaded, it is also present. If the module is
>being unloaded it is currently present and we need to wait.

It actually depends on what you want to do with this call. Technically
if it's in any state other than those above, it's not usable so we
return false.

From what I've seen in its use, those other states shouldn't matter.
And we could actually improve them. E.g.: igt_i915_driver_unload() could
first kill the potential users and then try to remove all the modules.

It doesn't matter if the module is loaded, libkmod will already do the
necessary checks: we just need to handle the return code properly.

A potential 3rd step would be to loop through the modules and warn if
any of them are still loaded.

Lucas De Marchi

>
>Looks like this should be ret = state >= 0 ? If the module is any of
>LIVE/BUILTIN/COMING/GOING it is presently loaded.
>-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [igt-dev] ✓ Fi.CI.IGT: success for series starting with [1/4] lib/igt_kmod: simplify check for loaded module
  2019-04-04 22:39 [igt-dev] [PATCH 1/4] lib/igt_kmod: simplify check for loaded module Lucas De Marchi
                   ` (4 preceding siblings ...)
  2019-04-04 23:39 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [1/4] " Patchwork
@ 2019-04-05 19:29 ` Patchwork
  2019-04-08 11:56   ` Petri Latvala
  5 siblings, 1 reply; 13+ messages in thread
From: Patchwork @ 2019-04-05 19:29 UTC (permalink / raw)
  To: Lucas De Marchi; +Cc: igt-dev

== Series Details ==

Series: series starting with [1/4] lib/igt_kmod: simplify check for loaded module
URL   : https://patchwork.freedesktop.org/series/59026/
State : success

== Summary ==

CI Bug Log - changes from IGT_4929_full -> IGTPW_2791_full
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/59026/revisions/1/mbox/

New tests
---------

  New tests have been introduced between IGT_4929_full and IGTPW_2791_full:

### New IGT tests (7) ###

  * igt@gem_exec_parallel@blt-basic:
    - Statuses : 5 pass(s)
    - Exec time: [0.81, 2.51] s

  * igt@gem_exec_parallel@bsd-basic:
    - Statuses : 4 pass(s) 1 skip(s)
    - Exec time: [0.0, 2.38] s

  * igt@gem_exec_parallel@bsd1-basic:
    - Statuses : 1 pass(s) 4 skip(s)
    - Exec time: [0.0, 0.78] s

  * igt@gem_exec_parallel@bsd2-basic:
    - Statuses : 1 pass(s) 4 skip(s)
    - Exec time: [0.0, 0.88] s

  * igt@gem_exec_parallel@default-basic:
    - Statuses : 5 pass(s)
    - Exec time: [0.72, 2.46] s

  * igt@gem_exec_parallel@render-basic:
    - Statuses : 5 pass(s)
    - Exec time: [0.73, 2.62] s

  * igt@gem_exec_parallel@vebox-basic:
    - Statuses : 4 pass(s) 1 skip(s)
    - Exec time: [0.0, 2.53] s

  

Known issues
------------

  Here are the changes found in IGTPW_2791_full that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_busy@extended-semaphore-blt:
    - shard-snb:          NOTRUN -> SKIP [fdo#109271] +41

  * igt@gem_exec_parallel@default-fds:
    - shard-hsw:          PASS -> SKIP [fdo#109271] +3

  * igt@gem_softpin@evict-snoop-interruptible:
    - shard-glk:          NOTRUN -> SKIP [fdo#109271] +47

  * igt@kms_atomic_transition@1x-modeset-transitions-nonblocking-fencing:
    - shard-apl:          PASS -> FAIL [fdo#109660]

  * igt@kms_atomic_transition@plane-toggle-modeset-transition:
    - shard-apl:          PASS -> INCOMPLETE [fdo#103927]

  * igt@kms_busy@basic-modeset-e:
    - shard-snb:          NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +1

  * igt@kms_busy@extended-modeset-hang-newfb-render-a:
    - shard-kbl:          PASS -> DMESG-WARN [fdo#110222] +1

  * igt@kms_busy@extended-modeset-hang-newfb-render-b:
    - shard-hsw:          PASS -> DMESG-WARN [fdo#110222] +1
    - shard-snb:          PASS -> DMESG-WARN [fdo#110222] +1

  * igt@kms_busy@extended-pageflip-hang-oldfb-render-f:
    - shard-apl:          NOTRUN -> SKIP [fdo#109271] / [fdo#109278]

  * igt@kms_busy@extended-pageflip-modeset-hang-oldfb-render-a:
    - shard-glk:          NOTRUN -> DMESG-WARN [fdo#110222]

  * igt@kms_chamelium@common-hpd-after-suspend:
    - shard-hsw:          NOTRUN -> SKIP [fdo#109271] +37

  * igt@kms_chamelium@vga-hpd:
    - shard-apl:          NOTRUN -> SKIP [fdo#109271] +20

  * igt@kms_concurrent@pipe-d:
    - shard-hsw:          NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +6

  * igt@kms_cursor_crc@cursor-256x256-suspend:
    - shard-kbl:          PASS -> DMESG-WARN [fdo#103313]

  * igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size:
    - shard-hsw:          NOTRUN -> INCOMPLETE [fdo#103540]

  * igt@kms_frontbuffer_tracking@psr-1p-primscrn-indfb-plflip-blt:
    - shard-kbl:          NOTRUN -> SKIP [fdo#109271] +24

  * igt@kms_lease@atomic_implicit_crtc:
    - shard-glk:          NOTRUN -> FAIL [fdo#110279]

  * igt@kms_lease@setcrtc_implicit_plane:
    - shard-glk:          NOTRUN -> FAIL [fdo#110281]

  * igt@kms_pipe_crc_basic@read-crc-pipe-e:
    - shard-kbl:          NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +1

  * igt@kms_plane@pixel-format-pipe-b-planes-source-clamping:
    - shard-glk:          PASS -> SKIP [fdo#109271] +1

  * igt@kms_plane_alpha_blend@pipe-b-alpha-transparant-fb:
    - shard-kbl:          NOTRUN -> FAIL [fdo#108145]
    - shard-apl:          NOTRUN -> FAIL [fdo#108145]

  * igt@kms_plane_alpha_blend@pipe-c-alpha-transparant-fb:
    - shard-glk:          NOTRUN -> FAIL [fdo#108145] +1

  * igt@kms_plane_scaling@pipe-a-scaler-with-clipping-clamping:
    - shard-glk:          NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +3

  * igt@kms_plane_scaling@pipe-a-scaler-with-pixel-format:
    - shard-glk:          PASS -> SKIP [fdo#109271] / [fdo#109278]

  * igt@kms_rotation_crc@multiplane-rotation:
    - shard-kbl:          PASS -> FAIL [fdo#109016]

  * igt@kms_vblank@pipe-a-ts-continuation-modeset-rpm:
    - shard-apl:          PASS -> FAIL [fdo#104894] +4

  
#### Possible fixes ####

  * igt@gem_eio@unwedge-stress:
    - shard-snb:          FAIL [fdo#109661] -> PASS

  * igt@gem_softpin@noreloc-s3:
    - shard-snb:          DMESG-WARN [fdo#102365] -> PASS

  * igt@i915_pm_rpm@pm-tiling:
    - shard-glk:          DMESG-WARN -> PASS

  * igt@kms_atomic_transition@plane-all-modeset-transition-fencing:
    - shard-apl:          INCOMPLETE [fdo#103927] -> PASS +1

  * igt@kms_cursor_crc@cursor-256x85-onscreen:
    - shard-apl:          FAIL [fdo#103232] -> PASS
    - shard-kbl:          FAIL [fdo#103232] -> PASS

  * igt@kms_flip@flip-vs-expired-vblank:
    - shard-glk:          FAIL [fdo#105363] -> PASS

  * igt@kms_setmode@basic:
    - shard-apl:          FAIL [fdo#99912] -> PASS

  * igt@testdisplay:
    - shard-kbl:          INCOMPLETE [fdo#103665] -> PASS

  
#### Warnings ####

  * igt@gem_tiled_swapping@non-threaded:
    - shard-hsw:          FAIL [fdo#108686] -> INCOMPLETE [fdo#103540]

  * igt@kms_universal_plane@disable-primary-vs-flip-pipe-f:
    - shard-hsw:          INCOMPLETE [fdo#103540] -> SKIP [fdo#109271] / [fdo#109278]

  * igt@runner@aborted:
    - shard-glk:          ( 2 FAIL ) [fdo#109373] / [k.org#202321] -> FAIL [fdo#109373] / [k.org#202321]

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#102365]: https://bugs.freedesktop.org/show_bug.cgi?id=102365
  [fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
  [fdo#103313]: https://bugs.freedesktop.org/show_bug.cgi?id=103313
  [fdo#103540]: https://bugs.freedesktop.org/show_bug.cgi?id=103540
  [fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
  [fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
  [fdo#104894]: https://bugs.freedesktop.org/show_bug.cgi?id=104894
  [fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
  [fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
  [fdo#108686]: https://bugs.freedesktop.org/show_bug.cgi?id=108686
  [fdo#109016]: https://bugs.freedesktop.org/show_bug.cgi?id=109016
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
  [fdo#109373]: https://bugs.freedesktop.org/show_bug.cgi?id=109373
  [fdo#109660]: https://bugs.freedesktop.org/show_bug.cgi?id=109660
  [fdo#109661]: https://bugs.freedesktop.org/show_bug.cgi?id=109661
  [fdo#110222]: https://bugs.freedesktop.org/show_bug.cgi?id=110222
  [fdo#110279]: https://bugs.freedesktop.org/show_bug.cgi?id=110279
  [fdo#110281]: https://bugs.freedesktop.org/show_bug.cgi?id=110281
  [fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912
  [k.org#202321]: https://bugzilla.kernel.org/show_bug.cgi?id=202321


Participating hosts (7 -> 5)
------------------------------

  Missing    (2): shard-skl shard-iclb 


Build changes
-------------

    * IGT: IGT_4929 -> IGTPW_2791

  CI_DRM_5875: 5cc7c47c44aaef5bfe07e7307d06caa98e401fad @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_2791: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2791/
  IGT_4929: 8770e24fe4008404da769c16b7edac6142225ad7 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2791/
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [igt-dev] ✓ Fi.CI.IGT: success for series starting with [1/4] lib/igt_kmod: simplify check for loaded module
  2019-04-05 19:29 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
@ 2019-04-08 11:56   ` Petri Latvala
  2019-04-30 17:09     ` Lucas De Marchi
  0 siblings, 1 reply; 13+ messages in thread
From: Petri Latvala @ 2019-04-08 11:56 UTC (permalink / raw)
  To: igt-dev; +Cc: Lucas De Marchi

On Fri, Apr 05, 2019 at 07:29:47PM +0000, Patchwork wrote:
>   * igt@gem_exec_parallel@default-fds:
>     - shard-hsw:          PASS -> SKIP [fdo#109271] +3


Now that patch 4 got merged, we have the -fds tests skipping on hsw
and icl shards, due to EPERM from setrlimit. The code attempts to set
RLIMIT_NOFILE to /proc/sys/fs/file-max when the documented limit for
RLIMIT_NOFILE is /proc/sys/fs/nr_open.


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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [igt-dev] ✓ Fi.CI.IGT: success for series starting with [1/4] lib/igt_kmod: simplify check for loaded module
  2019-04-08 11:56   ` Petri Latvala
@ 2019-04-30 17:09     ` Lucas De Marchi
  0 siblings, 0 replies; 13+ messages in thread
From: Lucas De Marchi @ 2019-04-30 17:09 UTC (permalink / raw)
  To: igt-dev

On Mon, Apr 08, 2019 at 02:56:52PM +0300, Petri Latvala wrote:
>On Fri, Apr 05, 2019 at 07:29:47PM +0000, Patchwork wrote:
>>   * igt@gem_exec_parallel@default-fds:
>>     - shard-hsw:          PASS -> SKIP [fdo#109271] +3
>
>
>Now that patch 4 got merged, we have the -fds tests skipping on hsw
>and icl shards, due to EPERM from setrlimit. The code attempts to set
>RLIMIT_NOFILE to /proc/sys/fs/file-max when the documented limit for
>RLIMIT_NOFILE is /proc/sys/fs/nr_open.

thanks for fixing that.

Lucas De Marchi

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2019-04-30 17:09 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-04 22:39 [igt-dev] [PATCH 1/4] lib/igt_kmod: simplify check for loaded module Lucas De Marchi
2019-04-04 22:39 ` [igt-dev] [PATCH 2/4] gem_exec_parallel: do not special case the default Lucas De Marchi
2019-04-04 22:57   ` Chris Wilson
2019-04-04 22:39 ` [igt-dev] [PATCH 3/4] lib: add igt_allow_unlimited_files() Lucas De Marchi
2019-04-04 23:00   ` Chris Wilson
2019-04-04 22:39 ` [igt-dev] [PATCH 4/4] gem_exec_parallel: allow unlimited open files Lucas De Marchi
2019-04-04 23:01   ` Chris Wilson
2019-04-04 23:19 ` [igt-dev] [PATCH 1/4] lib/igt_kmod: simplify check for loaded module Chris Wilson
2019-04-05 16:33   ` Lucas De Marchi
2019-04-04 23:39 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [1/4] " Patchwork
2019-04-05 19:29 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-04-08 11:56   ` Petri Latvala
2019-04-30 17:09     ` Lucas De Marchi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.