From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v3 08/13] drm/i915: Introduce a preempt context
Date: Fri, 29 Sep 2017 10:23:05 +0300 [thread overview]
Message-ID: <1506669785.4729.8.camel@linux.intel.com> (raw)
In-Reply-To: <20170928193910.17988-8-chris@chris-wilson.co.uk>
On Thu, 2017-09-28 at 20:39 +0100, Chris Wilson wrote:
> Add another perma-pinned context for using for preemption at any time.
> We cannot just reuse the existing kernel context, as first and foremost
> we need to ensure that we can preempt the kernel context itself, so
> require a distinct context id. Similar to the kernel context, we may
> want to interrupt execution and switch to the preempt context at any
> time, and so it needs to be permanently pinned and available.
>
> To compensate for yet another permanent allocation, we shrink the
> existing context and the new context by reducing their ringbuffer to the
> minimum.
>
> v2: Assert that we never allocate a request from the preemption context.
> v3: Limit perma-pin to engines that may preempt.
> v4: Onion cleanup for early driver death
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
<SNIP>
> @@ -507,15 +546,10 @@ void i915_gem_contexts_lost(struct drm_i915_private *dev_priv)
>
> void i915_gem_contexts_fini(struct drm_i915_private *i915)
> {
> - struct i915_gem_context *ctx;
> -
> lockdep_assert_held(&i915->drm.struct_mutex);
>
> - /* Keep the context so that we can free it immediately ourselves */
> - ctx = i915_gem_context_get(fetch_and_zero(&i915->kernel_context));
> - GEM_BUG_ON(!i915_gem_context_is_kernel(ctx));
> - context_close(ctx);
> - i915_gem_context_free(ctx);
> + destroy_kernel_context(&i915->kernel_context);
> + destroy_kernel_context(&i915->preempt_context);
You first create kernel, then pre-empt, destroy should be in the
reverse order, really.
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Regards, Joonas
--
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-09-29 7:23 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-28 19:38 [PATCH v3 01/13] drm/i915: Inherit Kabylake platform features from Skylake Chris Wilson
2017-09-28 19:38 ` [PATCH v3 02/13] drm/i915/execlists: Move request unwinding to a separate function Chris Wilson
2017-09-28 19:39 ` [PATCH v3 03/13] drm/i915: Give the invalid priority a magic name Chris Wilson
2017-09-29 6:39 ` Mika Kuoppala
2017-09-29 7:01 ` Joonas Lahtinen
2017-09-28 19:39 ` [PATCH v3 04/13] drm/i915/execlists: Cache the last priolist lookup Chris Wilson
2017-09-29 11:45 ` Chris Wilson
2017-09-28 19:39 ` [PATCH v3 05/13] drm/i915/preempt: Fix WaEnablePreemptionGranularityControlByUMD Chris Wilson
2017-09-28 19:39 ` [PATCH v3 06/13] drm/i915/preempt: Default to disabled mid-command preemption levels Chris Wilson
2017-09-29 7:18 ` Joonas Lahtinen
2017-09-28 19:39 ` [PATCH v3 07/13] drm/i915/execlists: Distinguish the incomplete context notifies Chris Wilson
2017-09-28 19:39 ` [PATCH v3 08/13] drm/i915: Introduce a preempt context Chris Wilson
2017-09-29 7:23 ` Joonas Lahtinen [this message]
2017-09-28 19:39 ` [PATCH v3 09/13] drm/i915/execlists: Move bdw GPGPU w/a to emit_bb Chris Wilson
2017-09-28 19:39 ` [PATCH v3 10/13] drm/i915/execlists: Keep request->priority for its lifetime Chris Wilson
2017-09-28 19:39 ` [PATCH v3 11/13] drm/i915: Expand I915_PARAM_HAS_SCHEDULER into a capability bitmask Chris Wilson
2017-09-28 19:39 ` [PATCH v3 12/13] drm/i915/execlists: Preemption! Chris Wilson
2017-09-29 6:55 ` Mika Kuoppala
2017-09-29 10:07 ` Chris Wilson
2017-09-29 7:29 ` Joonas Lahtinen
2017-09-29 10:12 ` Chris Wilson
2017-09-29 13:14 ` Joonas Lahtinen
2017-09-28 19:39 ` [PATCH v3 13/13] drm/i915/scheduler: Support user-defined priorities Chris Wilson
2017-09-29 7:32 ` Joonas Lahtinen
2017-09-28 19:58 ` [PATCH v3 01/13] drm/i915: Inherit Kabylake platform features from Skylake Rodrigo Vivi
2017-09-28 20:05 ` Chris Wilson
2017-09-28 21:04 ` ✗ Fi.CI.BAT: failure for series starting with [v3,01/13] " Patchwork
2017-09-29 10:29 ` ✓ Fi.CI.BAT: success " Patchwork
2017-09-29 11:20 ` [PATCH v3 01/13] " David Weinehall
2017-09-29 11:24 ` ✗ Fi.CI.IGT: failure for series starting with [v3,01/13] " 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=1506669785.4729.8.camel@linux.intel.com \
--to=joonas.lahtinen@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--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