From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
imre.deak@intel.com, Intel-gfx@lists.freedesktop.org,
Tvrtko Ursulin <tvrtko.ursulin@intel.com>,
Mika Kuoppala <mika.kuoppala@intel.com>
Subject: Re: [PATCH 2/2] drm/i915: Use atomic waits for short non-atomic ones
Date: Tue, 28 Jun 2016 15:40:24 +0100 [thread overview]
Message-ID: <57728C58.9070700@linux.intel.com> (raw)
In-Reply-To: <20160628141447.GD28577@nuc-i3427.alporthouse.com>
On 28/06/16 15:14, Chris Wilson wrote:
> On Tue, Jun 28, 2016 at 02:55:28PM +0100, Chris Wilson wrote:
>> On Tue, Jun 28, 2016 at 02:29:33PM +0100, Tvrtko Ursulin wrote:
>>> How would you implement it with cpu_clock? What would you do when
>>> re-scheduled?
>>
>> unsigned long base;
>> int cpu;
>> int ret;
>>
>> preempt_disable();
>> cpu = smp_processor_id();
>> base = local_clock() >> 10;
>> for (;;) {
>> u64 now = local_clock() >> 10;
>> preempt_enable();
>>
>> if (COND) {
>> ret = 0;
>> break;
>> }
>>
>> if (now - base >= timeout) {
>> ret = -ETIMEOUT;
>> break;
>> }
>>
>> cpu_relax();
>>
>> preempt_disable();
>> if (unlikely(cpu != smp_processor_id()) {
>> timeout -= now - base;
>
> For this, we should scale everything to ns (u64).
In other words not scale. Is this type of loop more preferable to you
guys vs how it looked in this original patch?
Only difference is the preempt off section is shorter here, but I don't
think that is interesting for the atomic waits case.
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-06-28 14:41 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-28 11:51 [PATCH 1/2] drm/i915/debug: Select PREEMPT_COUNT when enabling debugging Tvrtko Ursulin
2016-06-28 11:51 ` [PATCH 2/2] drm/i915: Use atomic waits for short non-atomic ones Tvrtko Ursulin
2016-06-28 12:19 ` Imre Deak
2016-06-28 13:29 ` Tvrtko Ursulin
2016-06-28 13:53 ` Imre Deak
2016-06-28 14:38 ` Tvrtko Ursulin
2016-06-28 17:45 ` Imre Deak
2016-06-28 13:55 ` Chris Wilson
2016-06-28 14:14 ` Chris Wilson
2016-06-28 14:40 ` Tvrtko Ursulin [this message]
2016-06-28 15:39 ` Chris Wilson
2016-06-28 16:16 ` [PATCH v2] " Tvrtko Ursulin
2016-06-28 16:20 ` [PATCH v3] " Tvrtko Ursulin
2016-06-28 19:55 ` Chris Wilson
2016-06-29 9:45 ` [PATCH v4] " Tvrtko Ursulin
2016-06-29 11:27 ` [PATCH v5] " Tvrtko Ursulin
2016-06-29 11:37 ` Chris Wilson
2016-06-28 12:19 ` [PATCH 2/2] " Chris Wilson
2016-06-28 12:41 ` ✓ Ro.CI.BAT: success for series starting with [1/2] drm/i915/debug: Select PREEMPT_COUNT when enabling debugging Patchwork
2016-06-28 13:41 ` [PATCH 1/2] " Chris Wilson
2016-06-28 15:24 ` kbuild test robot
2016-06-28 16:39 ` ✗ Ro.CI.BAT: warning for series starting with [1/2] drm/i915/debug: Select PREEMPT_COUNT when enabling debugging (rev2) Patchwork
2016-06-28 17:03 ` ✓ Ro.CI.BAT: success for series starting with [1/2] drm/i915/debug: Select PREEMPT_COUNT when enabling debugging (rev3) Patchwork
2016-06-28 19:59 ` Chris Wilson
2016-06-29 9:16 ` Tvrtko Ursulin
2016-06-29 10:11 ` ✗ Ro.CI.BAT: failure for series starting with [1/2] drm/i915/debug: Select PREEMPT_COUNT when enabling debugging (rev4) Patchwork
2016-06-29 11:50 ` ✗ Ro.CI.BAT: failure for series starting with [1/2] drm/i915/debug: Select PREEMPT_COUNT when enabling debugging (rev5) Patchwork
2016-06-29 14:54 ` Tvrtko Ursulin
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=57728C58.9070700@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=Intel-gfx@lists.freedesktop.org \
--cc=chris@chris-wilson.co.uk \
--cc=imre.deak@intel.com \
--cc=mika.kuoppala@intel.com \
--cc=tvrtko.ursulin@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