All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH igt] igt/gem_fd_exhaustion: Remove stale assert
@ 2017-10-20 10:24 Chris Wilson
  2017-10-20 11:00 ` ✓ Fi.CI.BAT: success for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Chris Wilson @ 2017-10-20 10:24 UTC (permalink / raw)
  To: intel-gfx

__gem_create() doesn't touch the outparam *handle on failure, so we can
no longer assert that it zero. This is reasonable to remove as it is just
testing the library itself and not the kernel, so no loss in coverage.
We already had to remove the false assertion that gem_create() must fail
following fd exhaustion (as we can not prevent the kernel from freeing
VFS fdspace in between calls).

The last remaining change is that we do no need to rely on an external
path for open() as dup() will do the job of exhausting the fdtable.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103365
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/gem_fd_exhaustion.c | 21 ++++-----------------
 1 file changed, 4 insertions(+), 17 deletions(-)

diff --git a/tests/gem_fd_exhaustion.c b/tests/gem_fd_exhaustion.c
index 250fe850..0969f9c6 100644
--- a/tests/gem_fd_exhaustion.c
+++ b/tests/gem_fd_exhaustion.c
@@ -33,11 +33,6 @@
 #include <fcntl.h>
 #include <limits.h>
 
-
-
-#define FD_ARR_SZ 100
-int fd_arr[FD_ARR_SZ];
-
 static bool allow_unlimited_files(void)
 {
 	struct rlimit rlim;
@@ -60,31 +55,23 @@ static bool allow_unlimited_files(void)
 
 igt_simple_main
 {
-	int fd, i;
+	int fd;
 
 	igt_require(allow_unlimited_files());
 
 	fd = drm_open_driver(DRIVER_INTEL);
 
-	igt_assert(open("/dev/null", O_RDONLY) >= 0);
-
 	igt_fork(n, 1) {
 		igt_drop_root();
 
-		for (i = 0; ; i++) {
-			int tmp_fd = open("/dev/null", O_RDONLY);
+		for (int i = 0; ; i++) {
+			int leak = dup(fd);
 			uint32_t handle;
 
-			if (tmp_fd >= 0 && i < FD_ARR_SZ)
-				fd_arr[i] = tmp_fd;
-
 			if (__gem_create(fd, 4096, &handle) == 0)
 				gem_close(fd, handle);
 
-
-			if (tmp_fd < 0) {
-				/* Ensure we actually hit the failure path ... */
-				igt_assert(handle == 0);
+			if (leak < 0) {
 				igt_info("fd exhaustion after %i rounds.\n", i);
 				break;
 			}
-- 
2.15.0.rc1

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

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

* ✓ Fi.CI.BAT: success for igt/gem_fd_exhaustion: Remove stale assert
  2017-10-20 10:24 [PATCH igt] igt/gem_fd_exhaustion: Remove stale assert Chris Wilson
@ 2017-10-20 11:00 ` Patchwork
  2017-10-20 12:34 ` ✗ Fi.CI.IGT: warning " Patchwork
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2017-10-20 11:00 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: igt/gem_fd_exhaustion: Remove stale assert
URL   : https://patchwork.freedesktop.org/series/32351/
State : success

== Summary ==

IGT patchset tested on top of latest successful build
abc08cba366a64a07f7f4deb167ae7d6ae059958 lib: Free all internal buffers before measuring available memory

with latest DRM-Tip kernel build CI_DRM_3269
75b85b0dce2f drm-tip: 2017y-10m-20d-10h-07m-16s UTC integration manifest

No testlist changes.

Test kms_pipe_crc_basic:
        Subgroup read-crc-pipe-b-frame-sequence:
                incomplete -> PASS       (fi-skl-6700hq) fdo#102035
        Subgroup suspend-read-crc-pipe-b:
                dmesg-warn -> PASS       (fi-byt-n2820) fdo#101705
Test prime_vgem:
        Subgroup basic-fence-flip:
                dmesg-warn -> PASS       (fi-kbl-7567u)
        Subgroup basic-fence-mmap:
                dmesg-warn -> PASS       (fi-kbl-7567u)

fdo#102035 https://bugs.freedesktop.org/show_bug.cgi?id=102035
fdo#101705 https://bugs.freedesktop.org/show_bug.cgi?id=101705

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:446s
fi-blb-e6850     total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:373s
fi-bsw-n3050     total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  time:528s
fi-bwr-2160      total:289  pass:183  dwarn:0   dfail:0   fail:0   skip:106 time:266s
fi-bxt-dsi       total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  time:501s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:504s
fi-byt-j1900     total:289  pass:253  dwarn:1   dfail:0   fail:0   skip:35  time:498s
fi-byt-n2820     total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:470s
fi-cfl-s         total:289  pass:253  dwarn:4   dfail:0   fail:0   skip:32  time:551s
fi-elk-e7500     total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:418s
fi-gdg-551       total:289  pass:178  dwarn:1   dfail:0   fail:1   skip:109 time:253s
fi-glk-1         total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:582s
fi-hsw-4770      total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:459s
fi-hsw-4770r     total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:429s
fi-ilk-650       total:289  pass:228  dwarn:0   dfail:0   fail:0   skip:61  time:440s
fi-ivb-3520m     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:474s
fi-ivb-3770      total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:460s
fi-kbl-7500u     total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  time:492s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:574s
fi-kbl-7567u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:484s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:584s
fi-pnv-d510      total:289  pass:222  dwarn:1   dfail:0   fail:0   skip:66  time:549s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:453s
fi-skl-6700hq    total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:649s
fi-skl-6700k     total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:519s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:497s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:453s
fi-snb-2520m     total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:583s
fi-snb-2600      total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  time:423s

== Logs ==

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

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

* ✗ Fi.CI.IGT: warning for igt/gem_fd_exhaustion: Remove stale assert
  2017-10-20 10:24 [PATCH igt] igt/gem_fd_exhaustion: Remove stale assert Chris Wilson
  2017-10-20 11:00 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2017-10-20 12:34 ` Patchwork
  2017-10-25 10:34 ` [PATCH igt] " Michał Winiarski
  2017-10-25 17:25 ` ✗ Fi.CI.BAT: failure for " Patchwork
  3 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2017-10-20 12:34 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: igt/gem_fd_exhaustion: Remove stale assert
URL   : https://patchwork.freedesktop.org/series/32351/
State : warning

== Summary ==

Test drv_module_reload:
        Subgroup basic-reload-inject:
                dmesg-warn -> PASS       (shard-hsw) fdo#102707 +1
Test kms_flip:
        Subgroup blt-wf_vblank-vs-dpms:
                dmesg-warn -> PASS       (shard-hsw)
        Subgroup plain-flip-ts-check:
                pass       -> FAIL       (shard-hsw) fdo#100368
Test kms_frontbuffer_tracking:
        Subgroup fbc-1p-offscren-pri-indfb-draw-mmap-cpu:
                skip       -> PASS       (shard-hsw)
        Subgroup fbc-1p-primscrn-cur-indfb-move:
                skip       -> PASS       (shard-hsw)
Test kms_busy:
        Subgroup extended-modeset-hang-newfb-with-reset-render-B:
                dmesg-warn -> PASS       (shard-hsw) fdo#103038
        Subgroup extended-modeset-hang-oldfb-with-reset-render-B:
                dmesg-warn -> PASS       (shard-hsw) fdo#102249
        Subgroup extended-modeset-hang-newfb-with-reset-render-A:
                pass       -> DMESG-WARN (shard-hsw)
Test kms_plane:
        Subgroup plane-position-hole-pipe-A-planes:
                skip       -> PASS       (shard-hsw)

fdo#102707 https://bugs.freedesktop.org/show_bug.cgi?id=102707
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103038 https://bugs.freedesktop.org/show_bug.cgi?id=103038
fdo#102249 https://bugs.freedesktop.org/show_bug.cgi?id=102249

shard-hsw        total:2540 pass:1428 dwarn:2   dfail:0   fail:9   skip:1101 time:9179s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_393/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH igt] igt/gem_fd_exhaustion: Remove stale assert
  2017-10-20 10:24 [PATCH igt] igt/gem_fd_exhaustion: Remove stale assert Chris Wilson
  2017-10-20 11:00 ` ✓ Fi.CI.BAT: success for " Patchwork
  2017-10-20 12:34 ` ✗ Fi.CI.IGT: warning " Patchwork
@ 2017-10-25 10:34 ` Michał Winiarski
  2017-10-25 10:44   ` Chris Wilson
  2017-10-25 17:25 ` ✗ Fi.CI.BAT: failure for " Patchwork
  3 siblings, 1 reply; 6+ messages in thread
From: Michał Winiarski @ 2017-10-25 10:34 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

On Fri, Oct 20, 2017 at 11:24:19AM +0100, Chris Wilson wrote:
> __gem_create() doesn't touch the outparam *handle on failure, so we can
> no longer assert that it zero. This is reasonable to remove as it is just
> testing the library itself and not the kernel, so no loss in coverage.
> We already had to remove the false assertion that gem_create() must fail
> following fd exhaustion (as we can not prevent the kernel from freeing
> VFS fdspace in between calls).
> 
> The last remaining change is that we do no need to rely on an external
> path for open() as dup() will do the job of exhausting the fdtable.
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103365
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>

But do we really need this test? Perhaps we could just remove it?

-Michał

> ---
>  tests/gem_fd_exhaustion.c | 21 ++++-----------------
>  1 file changed, 4 insertions(+), 17 deletions(-)
> 
> diff --git a/tests/gem_fd_exhaustion.c b/tests/gem_fd_exhaustion.c
> index 250fe850..0969f9c6 100644
> --- a/tests/gem_fd_exhaustion.c
> +++ b/tests/gem_fd_exhaustion.c
> @@ -33,11 +33,6 @@
>  #include <fcntl.h>
>  #include <limits.h>
>  
> -
> -
> -#define FD_ARR_SZ 100
> -int fd_arr[FD_ARR_SZ];
> -
>  static bool allow_unlimited_files(void)
>  {
>  	struct rlimit rlim;
> @@ -60,31 +55,23 @@ static bool allow_unlimited_files(void)
>  
>  igt_simple_main
>  {
> -	int fd, i;
> +	int fd;
>  
>  	igt_require(allow_unlimited_files());
>  
>  	fd = drm_open_driver(DRIVER_INTEL);
>  
> -	igt_assert(open("/dev/null", O_RDONLY) >= 0);
> -
>  	igt_fork(n, 1) {
>  		igt_drop_root();
>  
> -		for (i = 0; ; i++) {
> -			int tmp_fd = open("/dev/null", O_RDONLY);
> +		for (int i = 0; ; i++) {
> +			int leak = dup(fd);
>  			uint32_t handle;
>  
> -			if (tmp_fd >= 0 && i < FD_ARR_SZ)
> -				fd_arr[i] = tmp_fd;
> -
>  			if (__gem_create(fd, 4096, &handle) == 0)
>  				gem_close(fd, handle);
>  
> -
> -			if (tmp_fd < 0) {
> -				/* Ensure we actually hit the failure path ... */
> -				igt_assert(handle == 0);
> +			if (leak < 0) {
>  				igt_info("fd exhaustion after %i rounds.\n", i);
>  				break;
>  			}
> -- 
> 2.15.0.rc1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH igt] igt/gem_fd_exhaustion: Remove stale assert
  2017-10-25 10:34 ` [PATCH igt] " Michał Winiarski
@ 2017-10-25 10:44   ` Chris Wilson
  0 siblings, 0 replies; 6+ messages in thread
From: Chris Wilson @ 2017-10-25 10:44 UTC (permalink / raw)
  To: Michał Winiarski; +Cc: intel-gfx

Quoting Michał Winiarski (2017-10-25 11:34:27)
> On Fri, Oct 20, 2017 at 11:24:19AM +0100, Chris Wilson wrote:
> > __gem_create() doesn't touch the outparam *handle on failure, so we can
> > no longer assert that it zero. This is reasonable to remove as it is just
> > testing the library itself and not the kernel, so no loss in coverage.
> > We already had to remove the false assertion that gem_create() must fail
> > following fd exhaustion (as we can not prevent the kernel from freeing
> > VFS fdspace in between calls).
> > 
> > The last remaining change is that we do no need to rely on an external
> > path for open() as dup() will do the job of exhausting the fdtable.
> > 
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103365
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> 
> Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
> 
> But do we really need this test? Perhaps we could just remove it?

It's not a vital test, it runs up against a kernel limit that we can't
really check. It's the type of thing one would use to seed kcov-afl as a
hint towards the different boundary cases.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✗ Fi.CI.BAT: failure for igt/gem_fd_exhaustion: Remove stale assert
  2017-10-20 10:24 [PATCH igt] igt/gem_fd_exhaustion: Remove stale assert Chris Wilson
                   ` (2 preceding siblings ...)
  2017-10-25 10:34 ` [PATCH igt] " Michał Winiarski
@ 2017-10-25 17:25 ` Patchwork
  3 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2017-10-25 17:25 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: igt/gem_fd_exhaustion: Remove stale assert
URL   : https://patchwork.freedesktop.org/series/32351/
State : failure

== Summary ==

Series 32351 revision 1 was fully merged or fully failed: no git log

== Logs ==

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

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

end of thread, other threads:[~2017-10-25 17:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-20 10:24 [PATCH igt] igt/gem_fd_exhaustion: Remove stale assert Chris Wilson
2017-10-20 11:00 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-10-20 12:34 ` ✗ Fi.CI.IGT: warning " Patchwork
2017-10-25 10:34 ` [PATCH igt] " Michał Winiarski
2017-10-25 10:44   ` Chris Wilson
2017-10-25 17:25 ` ✗ Fi.CI.BAT: failure for " Patchwork

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.