linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org,
	linux-rt-users <linux-rt-users@vger.kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Carsten Emde <C.Emde@osadl.org>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	John Kacur <jkacur@redhat.com>, <stable-rt@vger.kernel.org>
Subject: [PATCH RT 09/19] gpu: i915: allow the user not to do the wbinvd
Date: Sun, 08 Sep 2013 11:14:04 -0400	[thread overview]
Message-ID: <20130908151447.241176823@goodmis.org> (raw)
In-Reply-To: 20130908151355.362583092@goodmis.org

[-- Attachment #1: 0009-gpu-i915-allow-the-user-not-to-do-the-wbinvd.patch --]
[-- Type: text/plain, Size: 2306 bytes --]

From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

The wbinvd() renders the system with i915 unusable on RT. Using this
expensive instruction avoids GPU trouble according to
   https://bugs.freedesktop.org/show_bug.cgi?id=62191

As a workaround for RT it is recommended to pin each GPU related process
to the same CPU and then disable this instruction via the module
paramter.

Cc: stable-rt@vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 drivers/gpu/drm/i915/i915_gem.c |   17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 18da42c..a3f72cb 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -36,6 +36,7 @@
 #include <linux/swap.h>
 #include <linux/pci.h>
 #include <linux/dma-buf.h>
+#include <linux/module.h>
 
 static __must_check int i915_gem_object_flush_gpu_write_domain(struct drm_i915_gem_object *obj);
 static void i915_gem_object_flush_gtt_write_domain(struct drm_i915_gem_object *obj);
@@ -2525,6 +2526,10 @@ static inline int fence_number(struct drm_i915_private *dev_priv,
 	return fence - dev_priv->fence_regs;
 }
 
+static bool do_wbinvd = true;
+module_param(do_wbinvd, bool, 0644);
+MODULE_PARM_DESC(do_wbinvd, "Do expensive synchronization. Say no after you pin each GPU process to the same CPU in order to lower the latency.");
+
 static void i915_gem_write_fence__ipi(void *data)
 {
 	wbinvd();
@@ -2548,8 +2553,16 @@ static void i915_gem_object_update_fence(struct drm_i915_gem_object *obj,
 	 * on each processor in order to manually flush all memory
 	 * transactions before updating the fence register.
 	 */
-	if (HAS_LLC(obj->base.dev))
-		on_each_cpu(i915_gem_write_fence__ipi, NULL, 1);
+	if (HAS_LLC(obj->base.dev)) {
+		if (do_wbinvd) {
+#ifdef CONFIG_PREEMPT_RT_FULL
+			pr_err_once("WARNING! The i915 invalidates all caches which increases the latency.");
+			pr_err_once("As a workaround use 'i915.do_wbinvd=no' and PIN each process doing ");
+			pr_err_once("any kind of GPU activity to the same CPU to avoid problems.");
+#endif
+			on_each_cpu(i915_gem_write_fence__ipi, NULL, 1);
+		}
+	}
 	i915_gem_write_fence(dev, fence_reg, enable ? obj : NULL);
 
 	if (enable) {
-- 
1.7.10.4

  parent reply	other threads:[~2013-09-08 15:14 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-08 15:13 [PATCH RT 00/19] 3.6.11.8-rt41-rc1 stable review Steven Rostedt
2013-09-08 15:13 ` [PATCH RT 01/19] sched/workqueue: Only wake up idle workers if not blocked on sleeping spin lock Steven Rostedt
2013-09-08 15:13 ` [PATCH RT 02/19] x86/mce: fix mce timer interval Steven Rostedt
2013-09-08 15:13 ` [PATCH RT 03/19] genirq: Set irq thread to RT priority on creation Steven Rostedt
2013-09-08 15:13 ` [PATCH RT 04/19] list_bl.h: make list head locking RT safe Steven Rostedt
2013-09-08 15:14 ` [PATCH RT 05/19] list_bl.h: fix it for for !SMP && !DEBUG_SPINLOCK Steven Rostedt
2013-09-08 15:14 ` [PATCH RT 06/19] timers: prepare for full preemption improve Steven Rostedt
2013-09-08 15:14 ` [PATCH RT 07/19] kernel/cpu: fix cpu down problem if kthreads cpu is going down Steven Rostedt
2013-09-08 15:14 ` [PATCH RT 08/19] kernel/hotplug: restore original cpu mask oncpu/down Steven Rostedt
2013-09-08 15:14 ` Steven Rostedt [this message]
2013-09-08 15:14 ` [PATCH RT 10/19] drm/i915: drop trace_i915_gem_ring_dispatch on rt Steven Rostedt
2013-09-08 15:14 ` [PATCH RT 11/19] sched: Distangle worker accounting from rqlock Steven Rostedt
2013-09-08 15:14 ` [PATCH RT 12/19] rt,ntp: Move call to schedule_delayed_work() to helper thread Steven Rostedt
2013-09-08 15:14 ` [PATCH RT 13/19] hpsa: fix warning with smp_processor_id() in preemptible section Steven Rostedt
2013-09-08 15:14 ` [PATCH RT 14/19] hwlat-detector: Update hwlat_detector to add outer loop detection Steven Rostedt
2013-09-08 15:14 ` [PATCH RT 15/19] hwlat-detect/trace: Export trace_clock_local for hwlat-detector Steven Rostedt
2013-09-08 15:14 ` [PATCH RT 16/19] hwlat-detector: Use trace_clock_local if available Steven Rostedt
2013-09-08 15:14 ` [PATCH RT 17/19] hwlat-detector: Use thread instead of stop machine Steven Rostedt
2013-09-08 15:14 ` [PATCH RT 18/19] genirq: do not invoke the affinity callback via a workqueue Steven Rostedt
2013-09-08 15:14 ` [PATCH RT 19/19] Linux 3.6.11.8-rt41-rc1 Steven Rostedt

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=20130908151447.241176823@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=C.Emde@osadl.org \
    --cc=bigeasy@linutronix.de \
    --cc=jkacur@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=stable-rt@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /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).