All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	igt-dev@lists.freedesktop.org
Cc: Intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [igt-dev] [PATCH i-g-t] gem_wsim: Fix preempt period assert
Date: Mon, 27 Apr 2020 10:05:25 +0100	[thread overview]
Message-ID: <158797832517.17035.11396007512401587276@build.alporthouse.com> (raw)
In-Reply-To: <20200427090014.10041-1-tvrtko.ursulin@linux.intel.com>

Quoting Tvrtko Ursulin (2020-04-27 10:00:14)
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> Recently added assert in a common helper used for calculating batch
> duration and preemption period is harmful when preemption is disabled on a
> context. Split out into low level and high level helper and use the former
> for preemption period queries.
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>  benchmarks/gem_wsim.c | 15 ++++++++++++---
>  1 file changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c
> index 81f47b86d619..ad4edb936920 100644
> --- a/benchmarks/gem_wsim.c
> +++ b/benchmarks/gem_wsim.c
> @@ -1151,7 +1151,7 @@ __get_ctx(struct workload *wrk, const struct w_step *w)
>  }
>  
>  static unsigned long
> -get_bb_sz(const struct w_step *w, unsigned int duration)
> +__get_bb_sz(const struct w_step *w, unsigned int duration)
>  {
>         enum intel_engine_id engine = w->engine;
>         struct ctx *ctx = __get_ctx(w->wrk, w);
> @@ -1165,6 +1165,15 @@ get_bb_sz(const struct w_step *w, unsigned int duration)
>         d = ALIGN(duration * engine_calib_map[engine] * sizeof(uint32_t) /
>                   nop_calibration_us,
>                   sizeof(uint32_t));

Preempt disabled == w->preempt_us = 0 => duration = 0.

Ok, that follows that d is expected to be 0. And the caller expands to
at least a page.

Not really convinced the assert is worth it, but
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

WARNING: multiple messages have this Message-ID (diff)
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	igt-dev@lists.freedesktop.org
Cc: Intel-gfx@lists.freedesktop.org,
	Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t] gem_wsim: Fix preempt period assert
Date: Mon, 27 Apr 2020 10:05:25 +0100	[thread overview]
Message-ID: <158797832517.17035.11396007512401587276@build.alporthouse.com> (raw)
In-Reply-To: <20200427090014.10041-1-tvrtko.ursulin@linux.intel.com>

Quoting Tvrtko Ursulin (2020-04-27 10:00:14)
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> Recently added assert in a common helper used for calculating batch
> duration and preemption period is harmful when preemption is disabled on a
> context. Split out into low level and high level helper and use the former
> for preemption period queries.
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>  benchmarks/gem_wsim.c | 15 ++++++++++++---
>  1 file changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c
> index 81f47b86d619..ad4edb936920 100644
> --- a/benchmarks/gem_wsim.c
> +++ b/benchmarks/gem_wsim.c
> @@ -1151,7 +1151,7 @@ __get_ctx(struct workload *wrk, const struct w_step *w)
>  }
>  
>  static unsigned long
> -get_bb_sz(const struct w_step *w, unsigned int duration)
> +__get_bb_sz(const struct w_step *w, unsigned int duration)
>  {
>         enum intel_engine_id engine = w->engine;
>         struct ctx *ctx = __get_ctx(w->wrk, w);
> @@ -1165,6 +1165,15 @@ get_bb_sz(const struct w_step *w, unsigned int duration)
>         d = ALIGN(duration * engine_calib_map[engine] * sizeof(uint32_t) /
>                   nop_calibration_us,
>                   sizeof(uint32_t));

Preempt disabled == w->preempt_us = 0 => duration = 0.

Ok, that follows that d is expected to be 0. And the caller expands to
at least a page.

Not really convinced the assert is worth it, but
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

  reply	other threads:[~2020-04-27  9:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-27  9:00 [Intel-gfx] [PATCH i-g-t] gem_wsim: Fix preempt period assert Tvrtko Ursulin
2020-04-27  9:00 ` [igt-dev] " Tvrtko Ursulin
2020-04-27  9:05 ` Chris Wilson [this message]
2020-04-27  9:05   ` Chris Wilson
2020-04-27  9:38 ` [igt-dev] ✗ Fi.CI.BAT: failure for " 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=158797832517.17035.11396007512401587276@build.alporthouse.com \
    --to=chris@chris-wilson.co.uk \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=tvrtko.ursulin@linux.intel.com \
    /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 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.