Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1283415
| Path | csiph.com!goblin3!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Pavel Machek <pavel@ucw.cz> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 2/2] drm/i915: Limit the busy wait on requests to 2us not 10ms! |
| Date | Thu, 03 Dec 2015 23:10:01 +0100 |
| Message-ID | <qBKeB-2ve-9@gated-at.bofh.it> (permalink) |
| References | <qv5Hc-20o-3@gated-at.bofh.it> <qv5Hc-20o-1@gated-at.bofh.it> |
| X-Original-To | Chris Wilson <chris@chris-wilson.co.uk> |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Content-Disposition | inline |
| User-Agent | Mutt/1.5.23 (2014-03-12) |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 56 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Jens Axboe <axboe@kernel.dk>, intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Daniel Vetter <daniel.vetter@ffwll.ch>, Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>, Eero Tamminen <eero.t.tamminen@intel.com>, "Rantala, Valtteri" <valtteri.rantala@intel.com>, stable@kernel.vger.org |
| X-Original-Date | Thu, 3 Dec 2015 23:03:17 +0100 |
| X-Original-Message-ID | <20151203220317.GE14427@amd> |
| X-Original-References | <1447594364-4206-1-git-send-email-chris@chris-wilson.co.uk> <1447594364-4206-2-git-send-email-chris@chris-wilson.co.uk> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1283415 |
Show key headers only | View raw
Hi!
> Reported-by: Jens Axboe <axboe@kernel.dk>
> Link: https://lkml.org/lkml/2015/11/12/621
> Cc: Jens Axboe <axboe@kernel.dk>
> Cc; "Rogozhkin, Dmitry V" <dmitry.v.rogozhkin@intel.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> Cc: Eero Tamminen <eero.t.tamminen@intel.com>
> Cc: "Rantala, Valtteri" <valtteri.rantala@intel.com>
> Cc: stable@kernel.vger.org
> ---
> drivers/gpu/drm/i915/i915_gem.c | 28 +++++++++++++++++++++++++---
> 1 file changed, 25 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 740530c571d1..2a88158bd1f7 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -1146,14 +1146,36 @@ static bool missed_irq(struct drm_i915_private *dev_priv,
> return test_bit(ring->id, &dev_priv->gpu_error.missed_irq_rings);
> }
>
> +static u64 local_clock_us(unsigned *cpu)
> +{
> + u64 t;
> +
> + *cpu = get_cpu();
> + t = local_clock() >> 10;
> + put_cpu();
> +
> + return t;
> +}
> +
> +static bool busywait_stop(u64 timeout, unsigned cpu)
> +{
> + unsigned this_cpu;
> +
> + if (time_after64(local_clock_us(&this_cpu), timeout))
> + return true;
> +
> + return this_cpu != cpu;
> +}
Perhaps you want to ask the timekeeping people for the right
primitive? I guess you are not the only one needing this..
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
Re: [PATCH 2/2] drm/i915: Limit the busy wait on requests to 2us not 10ms! Pavel Machek <pavel@ucw.cz> - 2015-12-03 23:10 +0100
csiph-web