intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: John.C.Harrison@Intel.com, Intel-GFX@Lists.FreeDesktop.Org
Subject: Re: [PATCH v6 4/7] drm/i915: Delay the freeing of requests until retire time
Date: Tue, 1 Mar 2016 16:18:23 +0100	[thread overview]
Message-ID: <56D5B2BF.9030600@linux.intel.com> (raw)
In-Reply-To: <1455805450-6304-5-git-send-email-John.C.Harrison@Intel.com>

Hey,

Op 18-02-16 om 15:24 schreef John.C.Harrison@Intel.com:
> From: John Harrison <John.C.Harrison@Intel.com>
>
> The request structure is reference counted. When the count reached
> zero, the request was immediately freed and all associated objects
> were unrefereced/unallocated. This meant that the driver mutex lock
> must be held at the point where the count reaches zero. This was fine
> while all references were held internally to the driver. However, the
> plan is to allow the underlying fence object (and hence the request
> itself) to be returned to other drivers and to userland. External
> users cannot be expected to acquire a driver private mutex lock.
>
> Rather than attempt to disentangle the request structure from the
> driver mutex lock, the decsion was to defer the free code until a
> later (safer) point. Hence this patch changes the unreference callback
> to merely move the request onto a delayed free list. The driver's
> retire worker thread will then process the list and actually call the
> free function on the requests.
>
> v2: New patch in series.
>
> v3: Updated after review comments by Tvrtko Ursulin. Rename list nodes
> to 'link' rather than 'list'. Update list processing to be more
> efficient/safer with respect to spinlocks.
>
> v4: Changed to use basic spinlocks rather than IRQ ones - missed
> update from earlier feedback by Tvrtko.
>
> v5: Improved a comment to keep the style checker happy.
>
> For: VIZ-5190
> Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Looks like Chris also mentioned it, but a fence can stay alive for an unknown period of time.

As a result when a fence is signaled all associated data should be freed as soon as the fence is signaled,
not when the last refcount is dropped to 0. This will remove the delayed free dance and clean up code. :)

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

  parent reply	other threads:[~2016-03-01 15:18 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-18 14:24 [PATCH v6 0/7] Convert requests to use struct fence John.C.Harrison
2016-02-18 14:24 ` [PATCH v6 1/7] drm/i915: " John.C.Harrison
2016-02-18 14:24 ` [PATCH v6 2/7] drm/i915: Removed now redudant parameter to i915_gem_request_completed() John.C.Harrison
2016-02-18 14:24 ` [PATCH v6 3/7] drm/i915: Add per context timelines to fence object John.C.Harrison
2016-02-18 14:49   ` Chris Wilson
2016-02-22 14:33     ` John Harrison
2016-02-24 10:45       ` Maarten Lankhorst
2016-02-18 14:24 ` [PATCH v6 4/7] drm/i915: Delay the freeing of requests until retire time John.C.Harrison
2016-02-18 14:48   ` Chris Wilson
2016-02-22 14:34     ` John Harrison
2016-03-01 15:18   ` Maarten Lankhorst [this message]
2016-03-14 15:20     ` John Harrison
2016-02-18 14:24 ` [PATCH v6 5/7] drm/i915: Interrupt driven fences John.C.Harrison
2016-02-18 14:24 ` [PATCH v6 6/7] drm/i915: Updated request structure tracing John.C.Harrison
2016-02-18 14:24 ` [PATCH v6 7/7] drm/i915: Cache last IRQ seqno to reduce IRQ overhead John.C.Harrison
2016-02-18 14:51 ` [PATCH v6 0/7] Convert requests to use struct fence Chris Wilson
2016-02-22 14:36   ` John Harrison
2016-02-18 15:01 ` ✗ Fi.CI.BAT: failure for Convert requests to use struct fence (rev3) 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=56D5B2BF.9030600@linux.intel.com \
    --to=maarten.lankhorst@linux.intel.com \
    --cc=Intel-GFX@Lists.FreeDesktop.Org \
    --cc=John.C.Harrison@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).