Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Fixup 64bit divides in timelines selftest
@ 2017-05-13  9:41 Chris Wilson
  2017-05-13 10:01 ` ✓ Fi.CI.BAT: success for " Patchwork
  2017-05-15  9:54 ` [PATCH] " Tvrtko Ursulin
  0 siblings, 2 replies; 4+ messages in thread
From: Chris Wilson @ 2017-05-13  9:41 UTC (permalink / raw)
  To: intel-gfx

Some 64b divides snuck in when doing the prng timing compensation.

Fixes: 4797948071f6 ("drm/i915: Squash repeated awaits on the same fence")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
 drivers/gpu/drm/i915/selftests/i915_gem_timeline.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_timeline.c b/drivers/gpu/drm/i915/selftests/i915_gem_timeline.c
index 6df00cc02c12..7a44dab631b8 100644
--- a/drivers/gpu/drm/i915/selftests/i915_gem_timeline.c
+++ b/drivers/gpu/drm/i915/selftests/i915_gem_timeline.c
@@ -126,7 +126,6 @@ static unsigned int random_engine(struct rnd_state *rnd)
 
 static int bench_sync(void *arg)
 {
-#define M (1 << 20)
 	struct rnd_state prng;
 	struct intel_timeline *tl;
 	unsigned long end_time, count;
@@ -158,7 +157,7 @@ static int bench_sync(void *arg)
 	kt = ktime_sub(ktime_get(), kt);
 	pr_debug("%s: %lu random evaluations, %lluns/prng\n",
 		 __func__, count, (long long)div64_ul(ktime_to_ns(kt), count));
-	prng32_1M = ktime_to_ns(kt) * M / count;
+	prng32_1M = div64_ul(ktime_to_ns(kt) << 20, count);
 
 	/* Benchmark (only) setting random context ids */
 	prandom_seed_state(&prng, i915_selftest.random_seed);
@@ -172,7 +171,7 @@ static int bench_sync(void *arg)
 		count++;
 	} while (!time_after(jiffies, end_time));
 	kt = ktime_sub(ktime_get(), kt);
-	kt = ktime_sub_ns(kt, count * prng32_1M * 2 / M);
+	kt = ktime_sub_ns(kt, (count * prng32_1M * 2) >> 20);
 	pr_info("%s: %lu random insertions, %lluns/insert\n",
 		__func__, count, (long long)div64_ul(ktime_to_ns(kt), count));
 
@@ -190,7 +189,7 @@ static int bench_sync(void *arg)
 		}
 	}
 	kt = ktime_sub(ktime_get(), kt);
-	kt = ktime_sub_ns(kt, count * prng32_1M * 2 / M);
+	kt = ktime_sub_ns(kt, (count * prng32_1M * 2) >> 20);
 	pr_info("%s: %lu random lookups, %lluns/lookup\n",
 		__func__, count, (long long)div64_ul(ktime_to_ns(kt), count));
 
@@ -248,7 +247,7 @@ static int bench_sync(void *arg)
 		count++;
 	} while (!time_after(jiffies, end_time));
 	kt = ktime_sub(ktime_get(), kt);
-	kt = ktime_sub_ns(kt, count * prng32_1M * 2 / M);
+	kt = ktime_sub_ns(kt, (count * prng32_1M * 2) >> 20);
 	pr_info("%s: %lu repeated insert/lookups, %lluns/op\n",
 		__func__, count, (long long)div64_ul(ktime_to_ns(kt), count));
 	mock_timeline_destroy(tl);
@@ -287,7 +286,6 @@ static int bench_sync(void *arg)
 	}
 
 	return 0;
-#undef M
 }
 
 int i915_gem_timeline_mock_selftests(void)
-- 
2.11.0

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

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

* ✓ Fi.CI.BAT: success for drm/i915: Fixup 64bit divides in timelines selftest
  2017-05-13  9:41 [PATCH] drm/i915: Fixup 64bit divides in timelines selftest Chris Wilson
@ 2017-05-13 10:01 ` Patchwork
  2017-05-15  9:54 ` [PATCH] " Tvrtko Ursulin
  1 sibling, 0 replies; 4+ messages in thread
From: Patchwork @ 2017-05-13 10:01 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Fixup 64bit divides in timelines selftest
URL   : https://patchwork.freedesktop.org/series/24390/
State : success

== Summary ==

Series 24390v1 drm/i915: Fixup 64bit divides in timelines selftest
https://patchwork.freedesktop.org/api/1.0/series/24390/revisions/1/mbox/

fi-bdw-gvtdvm    total:278  pass:256  dwarn:8   dfail:0   fail:0   skip:14  time:432s
fi-bxt-j4205     total:278  pass:259  dwarn:0   dfail:0   fail:0   skip:19  time:513s
fi-byt-j1900     total:278  pass:254  dwarn:0   dfail:0   fail:0   skip:24  time:496s
fi-byt-n2820     total:278  pass:250  dwarn:0   dfail:0   fail:0   skip:28  time:486s
fi-hsw-4770      total:278  pass:262  dwarn:0   dfail:0   fail:0   skip:16  time:414s
fi-ilk-650       total:278  pass:228  dwarn:0   dfail:0   fail:0   skip:50  time:421s
fi-ivb-3520m     total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18  time:501s
fi-kbl-7500u     total:278  pass:255  dwarn:5   dfail:0   fail:0   skip:18  time:469s
fi-kbl-7560u     total:278  pass:263  dwarn:5   dfail:0   fail:0   skip:10  time:666s
fi-skl-6700hq    total:278  pass:261  dwarn:0   dfail:0   fail:0   skip:17  time:576s
fi-skl-6700k     total:278  pass:256  dwarn:4   dfail:0   fail:0   skip:18  time:470s
fi-skl-6770hq    total:278  pass:268  dwarn:0   dfail:0   fail:0   skip:10  time:496s
fi-skl-gvtdvm    total:278  pass:265  dwarn:0   dfail:0   fail:0   skip:13  time:437s
fi-snb-2520m     total:278  pass:250  dwarn:0   dfail:0   fail:0   skip:28  time:539s
fi-snb-2600      total:278  pass:249  dwarn:0   dfail:0   fail:0   skip:29  time:409s

f44cb9178bce8f077c0cfdaf2f71678629fdcccb drm-tip: 2017y-05m-13d-09h-14m-06s UTC integration manifest
d39eb35 drm/i915: Fixup 64bit divides in timelines selftest

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_4691/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915: Fixup 64bit divides in timelines selftest
  2017-05-13  9:41 [PATCH] drm/i915: Fixup 64bit divides in timelines selftest Chris Wilson
  2017-05-13 10:01 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2017-05-15  9:54 ` Tvrtko Ursulin
  2017-05-15 13:45   ` Chris Wilson
  1 sibling, 1 reply; 4+ messages in thread
From: Tvrtko Ursulin @ 2017-05-15  9:54 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx


On 13/05/2017 10:41, Chris Wilson wrote:
> Some 64b divides snuck in when doing the prng timing compensation.
>
> Fixes: 4797948071f6 ("drm/i915: Squash repeated awaits on the same fence")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/selftests/i915_gem_timeline.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_timeline.c b/drivers/gpu/drm/i915/selftests/i915_gem_timeline.c
> index 6df00cc02c12..7a44dab631b8 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_gem_timeline.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_gem_timeline.c
> @@ -126,7 +126,6 @@ static unsigned int random_engine(struct rnd_state *rnd)
>
>  static int bench_sync(void *arg)
>  {
> -#define M (1 << 20)
>  	struct rnd_state prng;
>  	struct intel_timeline *tl;
>  	unsigned long end_time, count;
> @@ -158,7 +157,7 @@ static int bench_sync(void *arg)
>  	kt = ktime_sub(ktime_get(), kt);
>  	pr_debug("%s: %lu random evaluations, %lluns/prng\n",
>  		 __func__, count, (long long)div64_ul(ktime_to_ns(kt), count));
> -	prng32_1M = ktime_to_ns(kt) * M / count;
> +	prng32_1M = div64_ul(ktime_to_ns(kt) << 20, count);
>
>  	/* Benchmark (only) setting random context ids */
>  	prandom_seed_state(&prng, i915_selftest.random_seed);
> @@ -172,7 +171,7 @@ static int bench_sync(void *arg)
>  		count++;
>  	} while (!time_after(jiffies, end_time));
>  	kt = ktime_sub(ktime_get(), kt);
> -	kt = ktime_sub_ns(kt, count * prng32_1M * 2 / M);
> +	kt = ktime_sub_ns(kt, (count * prng32_1M * 2) >> 20);
>  	pr_info("%s: %lu random insertions, %lluns/insert\n",
>  		__func__, count, (long long)div64_ul(ktime_to_ns(kt), count));
>
> @@ -190,7 +189,7 @@ static int bench_sync(void *arg)
>  		}
>  	}
>  	kt = ktime_sub(ktime_get(), kt);
> -	kt = ktime_sub_ns(kt, count * prng32_1M * 2 / M);
> +	kt = ktime_sub_ns(kt, (count * prng32_1M * 2) >> 20);
>  	pr_info("%s: %lu random lookups, %lluns/lookup\n",
>  		__func__, count, (long long)div64_ul(ktime_to_ns(kt), count));
>
> @@ -248,7 +247,7 @@ static int bench_sync(void *arg)
>  		count++;
>  	} while (!time_after(jiffies, end_time));
>  	kt = ktime_sub(ktime_get(), kt);
> -	kt = ktime_sub_ns(kt, count * prng32_1M * 2 / M);
> +	kt = ktime_sub_ns(kt, (count * prng32_1M * 2) >> 20);
>  	pr_info("%s: %lu repeated insert/lookups, %lluns/op\n",
>  		__func__, count, (long long)div64_ul(ktime_to_ns(kt), count));
>  	mock_timeline_destroy(tl);
> @@ -287,7 +286,6 @@ static int bench_sync(void *arg)
>  	}
>
>  	return 0;
> -#undef M
>  }
>
>  int i915_gem_timeline_mock_selftests(void)
>

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

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

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

* Re: [PATCH] drm/i915: Fixup 64bit divides in timelines selftest
  2017-05-15  9:54 ` [PATCH] " Tvrtko Ursulin
@ 2017-05-15 13:45   ` Chris Wilson
  0 siblings, 0 replies; 4+ messages in thread
From: Chris Wilson @ 2017-05-15 13:45 UTC (permalink / raw)
  To: Tvrtko Ursulin; +Cc: intel-gfx

On Mon, May 15, 2017 at 10:54:10AM +0100, Tvrtko Ursulin wrote:
> 
> On 13/05/2017 10:41, Chris Wilson wrote:
> >Some 64b divides snuck in when doing the prng timing compensation.
> >
> >Fixes: 4797948071f6 ("drm/i915: Squash repeated awaits on the same fence")
> >Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> >Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> >Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> >---
> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Pushed, thanks.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2017-05-15 13:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-13  9:41 [PATCH] drm/i915: Fixup 64bit divides in timelines selftest Chris Wilson
2017-05-13 10:01 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-05-15  9:54 ` [PATCH] " Tvrtko Ursulin
2017-05-15 13:45   ` Chris Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox