Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, igt-dev@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH i-g-t 05/17] lib: Spin fast, retire early
Date: Mon, 2 Jul 2018 16:36:28 +0100	[thread overview]
Message-ID: <59be4b41-b731-5af6-db1c-30942c28b717@linux.intel.com> (raw)
In-Reply-To: <20180702090727.7721-5-chris@chris-wilson.co.uk>


On 02/07/2018 10:07, Chris Wilson wrote:
> When using the pollable spinner, we often want to use it as a means of
> ensuring the task is running on the GPU before switching to something
> else. In which case we don't want to add extra delay inside the spinner,
> but the current 1000 NOPs add on order of 5us, which is often larger
> than the target latency.
> 
> v2: Don't change perf_pmu as that is sensitive to the extra CPU latency
> from a tight GPU spinner.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com> #v1
> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> #v1
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>   lib/igt_dummyload.c       | 3 ++-
>   lib/igt_dummyload.h       | 1 +
>   tests/gem_ctx_isolation.c | 1 +
>   tests/gem_eio.c           | 1 +
>   tests/gem_exec_latency.c  | 4 ++--
>   5 files changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
> index 94efdf745..7beb66244 100644
> --- a/lib/igt_dummyload.c
> +++ b/lib/igt_dummyload.c
> @@ -199,7 +199,8 @@ emit_recursive_batch(igt_spin_t *spin,
>   	 * between function calls, that appears enough to keep SNB out of
>   	 * trouble. See https://bugs.freedesktop.org/show_bug.cgi?id=102262
>   	 */
> -	batch += 1000;
> +	if (!(opts->flags & IGT_SPIN_FAST))
> +		batch += 1000;

igt_require(!snb) or something, given the comment whose last two lines 
can be seen in the diff above?

Regards,

Tvrtko

>   
>   	/* recurse */
>   	r = &relocs[obj[BATCH].relocation_count++];
> diff --git a/lib/igt_dummyload.h b/lib/igt_dummyload.h
> index c794f2544..e80a12451 100644
> --- a/lib/igt_dummyload.h
> +++ b/lib/igt_dummyload.h
> @@ -52,6 +52,7 @@ struct igt_spin_factory {
>   
>   #define IGT_SPIN_FENCE_OUT (1 << 0)
>   #define IGT_SPIN_POLL_RUN  (1 << 1)
> +#define IGT_SPIN_FAST      (1 << 2)
>   
>   igt_spin_t *
>   __igt_spin_batch_factory(int fd, const struct igt_spin_factory *opts);
> diff --git a/tests/gem_ctx_isolation.c b/tests/gem_ctx_isolation.c
> index 2e19e8c03..4325e1c28 100644
> --- a/tests/gem_ctx_isolation.c
> +++ b/tests/gem_ctx_isolation.c
> @@ -560,6 +560,7 @@ static void inject_reset_context(int fd, unsigned int engine)
>   	struct igt_spin_factory opts = {
>   		.ctx = gem_context_create(fd),
>   		.engine = engine,
> +		.flags = IGT_SPIN_FAST,
>   	};
>   	igt_spin_t *spin;
>   
> diff --git a/tests/gem_eio.c b/tests/gem_eio.c
> index 0ec1aaec9..3162a3170 100644
> --- a/tests/gem_eio.c
> +++ b/tests/gem_eio.c
> @@ -160,6 +160,7 @@ static igt_spin_t * __spin_poll(int fd, uint32_t ctx, unsigned long flags)
>   	struct igt_spin_factory opts = {
>   		.ctx = ctx,
>   		.engine = flags,
> +		.flags = IGT_SPIN_FAST,
>   	};
>   
>   	if (gem_can_store_dword(fd, opts.engine))
> diff --git a/tests/gem_exec_latency.c b/tests/gem_exec_latency.c
> index 75811f325..de16322a6 100644
> --- a/tests/gem_exec_latency.c
> +++ b/tests/gem_exec_latency.c
> @@ -65,7 +65,7 @@ poll_ring(int fd, unsigned ring, const char *name)
>   {
>   	const struct igt_spin_factory opts = {
>   		.engine = ring,
> -		.flags = IGT_SPIN_POLL_RUN,
> +		.flags = IGT_SPIN_POLL_RUN | IGT_SPIN_FAST,
>   	};
>   	struct timespec tv = {};
>   	unsigned long cycles;
> @@ -464,7 +464,7 @@ rthog_latency_on_ring(int fd, unsigned int engine, const char *name, unsigned in
>   #define MMAP_SZ (64 << 10)
>   	const struct igt_spin_factory opts = {
>   		.engine = engine,
> -		.flags = IGT_SPIN_POLL_RUN,
> +		.flags = IGT_SPIN_POLL_RUN | IGT_SPIN_FAST,
>   	};
>   	struct rt_pkt *results;
>   	unsigned int engines[16];
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-07-02 15:36 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-02  9:07 [Intel-gfx] [PATCH i-g-t 01/17] lib: Report file cache as available system memory Chris Wilson
2018-07-02  9:07 ` [igt-dev] [PATCH i-g-t 02/17] igt/gem_tiled_partial_pwrite_pread: Check for known swizzling Chris Wilson
2018-07-02 12:00   ` Tvrtko Ursulin
2018-07-05 11:14     ` [Intel-gfx] " Chris Wilson
2018-07-05 12:30       ` Tvrtko Ursulin
2018-07-05 12:35         ` Chris Wilson
2018-07-05 15:26           ` Tvrtko Ursulin
2018-07-05 15:55             ` Chris Wilson
2018-07-02  9:07 ` [Intel-gfx] [PATCH i-g-t 03/17] igt/gem_set_tiling_vs_pwrite: Show the erroneous value Chris Wilson
2018-07-02 12:00   ` [igt-dev] " Tvrtko Ursulin
2018-07-02  9:07 ` [igt-dev] [PATCH i-g-t 04/17] lib: Convert spin batch constructor to a factory Chris Wilson
2018-07-02 15:34   ` Tvrtko Ursulin
2018-07-02  9:07 ` [igt-dev] [PATCH i-g-t 05/17] lib: Spin fast, retire early Chris Wilson
2018-07-02 15:36   ` Tvrtko Ursulin [this message]
2018-07-05 11:23     ` [igt-dev] [Intel-gfx] " Chris Wilson
2018-07-05 12:33       ` Tvrtko Ursulin
2018-07-05 12:42         ` [igt-dev] " Chris Wilson
2018-07-05 15:29           ` Tvrtko Ursulin
2018-07-05 15:52             ` Chris Wilson
2018-07-02  9:07 ` [Intel-gfx] [PATCH i-g-t 06/17] igt/gem_sync: Alternate stress for nop+sync Chris Wilson
2018-07-02  9:07 ` [igt-dev] [PATCH i-g-t 07/17] igt/gem_sync: Double the wakeups, twice the pain Chris Wilson
2018-07-02  9:07 ` [igt-dev] [PATCH i-g-t 08/17] igt/gem_sync: Show the baseline poll latency for wakeups Chris Wilson
2018-07-02  9:07 ` [igt-dev] [PATCH i-g-t 09/17] igt/gem_userptr: Check read-only mappings Chris Wilson
2018-07-02  9:07 ` [Intel-gfx] [PATCH i-g-t 10/17] igt: Exercise creating context with shared GTT Chris Wilson
2018-07-02  9:07 ` [Intel-gfx] [PATCH i-g-t 11/17] igt/gem_ctx_switch: Exercise queues Chris Wilson
2018-07-02  9:07 ` [igt-dev] [PATCH i-g-t 12/17] igt/gem_exec_whisper: Fork all-engine tests one-per-engine Chris Wilson
2018-07-02  9:07 ` [igt-dev] [PATCH i-g-t 13/17] igt: Add gem_ctx_engines Chris Wilson
2018-07-02  9:07 ` [igt-dev] [PATCH i-g-t 14/17] igt: Add gem_exec_balancer Chris Wilson
2018-07-02  9:07 ` [igt-dev] [PATCH i-g-t 15/17] benchmarks/wsim: Simulate and interpret .wsim Chris Wilson
2018-07-02  9:07 ` [igt-dev] [PATCH i-g-t 16/17] tools: capture execution pathways Chris Wilson
2018-07-02  9:07 ` [igt-dev] [PATCH i-g-t 17/17] igt/gem_exec_latency: Robustify measurements Chris Wilson
2018-07-02 11:54 ` [igt-dev] [PATCH i-g-t 01/17] lib: Report file cache as available system memory Tvrtko Ursulin
2018-07-02 12:08   ` Chris Wilson
2018-07-02 13:09 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,01/17] " Patchwork
2018-07-02 14:16 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=59be4b41-b731-5af6-db1c-30942c28b717@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox