All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] tests/core_auth: set rlimit
@ 2017-08-04 14:38 Daniel Vetter
  2017-08-07 11:22 ` Arkadiusz Hiler
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Vetter @ 2017-08-04 14:38 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Tomi Sarvela, Daniel Vetter, Daniel Vetter

Some distros have huge rlimits and then the test takes forever, or
worse oom, or even worse, takse down the entire machine (which is
shouldn't be able to, but oh well, oom handling in linux).

Make sure we have a consistent rlimit by adjusting it manually.

v2: Use the default of 1024 from everywhere except ubuntu.

Cc: Tomi Sarvela <tomi.p.sarvela@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 tests/core_auth.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tests/core_auth.c b/tests/core_auth.c
index e08c8aed4c63..cedcff923937 100644
--- a/tests/core_auth.c
+++ b/tests/core_auth.c
@@ -39,6 +39,7 @@
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include <sys/poll.h>
+#include <sys/resource.h>
 #include "drm.h"
 
 IGT_TEST_DESCRIPTION("Call drmGetMagic() and drmAuthMagic() and see if it behaves.");
@@ -55,6 +56,12 @@ static void test_many_magics(int master)
 	char path[512];
 	int *fds = NULL, slave;
 
+	struct rlimit fd_limit;
+
+	do_or_die(getrlimit(RLIMIT_NOFILE, &fd_limit));
+	fd_limit.rlim_cur = 1024;
+	do_or_die(setrlimit(RLIMIT_NOFILE, &fd_limit));
+
 	sprintf(path, "/proc/self/fd/%d", master);
 
 	for (i = 0; ; ++i) {
@@ -157,6 +164,7 @@ igt_main
 	igt_subtest("basic-auth")
 		test_basic_auth(master);
 
+	/* this must be last, we adjust the rlimit */
 	igt_subtest("many-magics")
 		test_many_magics(master);
 }
-- 
2.5.5

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

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

* Re: [PATCH i-g-t] tests/core_auth: set rlimit
  2017-08-04 14:38 [PATCH i-g-t] tests/core_auth: set rlimit Daniel Vetter
@ 2017-08-07 11:22 ` Arkadiusz Hiler
  0 siblings, 0 replies; 2+ messages in thread
From: Arkadiusz Hiler @ 2017-08-07 11:22 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Tomi Sarvela, Daniel Vetter, Intel Graphics Development

On Fri, Aug 04, 2017 at 04:38:51PM +0200, Daniel Vetter wrote:
> Some distros have huge rlimits and then the test takes forever, or
> worse oom, or even worse, takse down the entire machine (which is
> shouldn't be able to, but oh well, oom handling in linux).
> 
> Make sure we have a consistent rlimit by adjusting it manually.
> 
> v2: Use the default of 1024 from everywhere except ubuntu.
> 
> Cc: Tomi Sarvela <tomi.p.sarvela@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2017-08-07 11:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-04 14:38 [PATCH i-g-t] tests/core_auth: set rlimit Daniel Vetter
2017-08-07 11:22 ` Arkadiusz Hiler

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.