From: Dave Gordon <david.s.gordon@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/3] drm/i915: Use consistent forcewake auto-release timeout across kernel configs
Date: Mon, 4 Apr 2016 20:41:20 +0100 [thread overview]
Message-ID: <5702C360.7010500@intel.com> (raw)
In-Reply-To: <20160404185809.GA5867@nuc-i3427.alporthouse.com>
On 04/04/16 19:58, Chris Wilson wrote:
> On Mon, Apr 04, 2016 at 05:51:09PM +0100, Tvrtko Ursulin wrote:
>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>
>> Current implementation releases the forcewake at any time between
>> straight away, and one jiffie from the last put, or first automatic
>> grab.
>
> That isn't the problem though. The problem is that we set the timer on
> first use rather than last use. All you are stating here is that by
> lengthening the timeout on your system you reduce the number of times it
> times out.
I thought that was already done, per my comments on one of your recent
patches (rename __force_wake_get to __force_wake_auto) and your reply
(gains are probably worth extra complexity). But of course Tvrtko wasn't
here the last few days so may not have seen that. I suppose it would
make sense to fold both changes together.
But changing the timeout to 1ms makes it generally *shorter* than
before, not longer. The gain can't just be from having a longer timeout,
'cos it isn't. (Average timeout now 1.5ms vs. previous 8ms?)
I think it should come from the fact that accesses are likely to be
bursty, having a bimodal distribution in the time domain. When we've
made one access, we're likely to make another much sooner than 1ms
later, but once we stop making accesses there will probably be far more
than 1ms before the next set of accesses.
> Having said that, the conversion to hrtimer seems sensible but to add
> tracking of the last access as opposed to first we either fallback to
> jiffie (in which case hrtimer is moot) or rely on ktime_get_raw() being
> fast enough for every register write. Hmm, my usual response to that has
> been if it matters we avoid the heavyweight macros and use the _FW
> interface - or even raw readl/writel.
>
> Could you try storing ktime_get_raw() on every access and rearming the
> timer if it expires before last-access + min-period?
> -Chris
One more idea - do we want two different expiry periods depending on
whether the caller used the _auto version or not?
If they did, they're probably anticipating "only a few" accesses in the
current operation, but perhaps with no idea about when the next set of
accesses will occur.
If not, then the final decrement means they think they've finished for a
while, and perhaps don't expect to come back for quite a long time. In
that situation the timeout only helps avoid rapid off/on cycles by
unrelated functions, not between logically-related operations.
So would two different timeouts make sense? Or even ...
_auto: longish timeout from the *first* _get() - don't rearm thereafter
other: shortish timeout from the _put() - non-auto _get() will cancel
or is that just too complicated?
.Dave.
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-04-04 19:41 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-04 16:51 [PATCH 1/3] drm/i915: Use consistent forcewake auto-release timeout across kernel configs Tvrtko Ursulin
2016-04-04 16:51 ` [PATCH 2/3] drm/i915: Simplify for_each_fw_domain iterators Tvrtko Ursulin
2016-04-04 19:00 ` Chris Wilson
2016-04-04 19:14 ` Dave Gordon
2016-04-05 9:05 ` Tvrtko Ursulin
2016-04-05 9:36 ` Chris Wilson
2016-04-04 16:51 ` [PATCH 3/3] drm/i915: Do not serialize forcewake acquire across domains Tvrtko Ursulin
2016-04-04 19:07 ` Chris Wilson
2016-04-05 9:02 ` Tvrtko Ursulin
2016-04-05 9:47 ` Chris Wilson
2016-04-04 18:58 ` [PATCH 1/3] drm/i915: Use consistent forcewake auto-release timeout across kernel configs Chris Wilson
2016-04-04 19:41 ` Dave Gordon [this message]
2016-04-04 20:22 ` Chris Wilson
2016-04-05 8:54 ` Tvrtko Ursulin
2016-04-05 8:59 ` Chris Wilson
2016-04-05 10:02 ` Tvrtko Ursulin
2016-04-05 10:44 ` Chris Wilson
2016-04-04 18:58 ` Dave Gordon
2016-04-05 6:26 ` ✗ Fi.CI.BAT: failure for series starting with [1/3] " Patchwork
2016-04-05 11:01 ` [PATCH v2 1/3] " Tvrtko Ursulin
2016-04-05 11:01 ` [PATCH v2 2/3] drm/i915: Simplify for_each_fw_domain iterators Tvrtko Ursulin
2016-04-05 11:01 ` [PATCH v2 3/3] drm/i915: Do not serialize forcewake acquire across domains Tvrtko Ursulin
2016-04-05 11:22 ` [PATCH v2 1/3] drm/i915: Use consistent forcewake auto-release timeout across kernel configs Chris Wilson
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=5702C360.7010500@intel.com \
--to=david.s.gordon@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