mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ross Zwisler <ross.zwisler@linux.intel.com>
To: linux-kernel@vger.kernel.org
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>,
	H Peter Anvin <h.peter.anvin@intel.com>,
	Ingo Molnar <mingo@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: [PATCH 3/4] x86: Use clflushopt in drm_clflush_page
Date: Wed, 26 Feb 2014 12:06:51 -0700	[thread overview]
Message-ID: <1393441612-19729-4-git-send-email-ross.zwisler@linux.intel.com> (raw)
In-Reply-To: <1393441612-19729-1-git-send-email-ross.zwisler@linux.intel.com>

If clflushopt is available on the system, use it instead of clflush in
drm_clflush_page.

Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: H Peter Anvin <h.peter.anvin@intel.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
---
 drivers/gpu/drm/drm_cache.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_cache.c b/drivers/gpu/drm/drm_cache.c
index bb8f580..c518fb6 100644
--- a/drivers/gpu/drm/drm_cache.c
+++ b/drivers/gpu/drm/drm_cache.c
@@ -32,6 +32,12 @@
 #include <drm/drmP.h>
 
 #if defined(CONFIG_X86)
+
+/*
+ * clflushopt is an unordered instruction which needs fencing with mfence or
+ * sfence to avoid ordering issues.  For drm_clflush_page this fencing happens
+ * in the caller.
+ */
 static void
 drm_clflush_page(struct page *page)
 {
@@ -44,7 +50,7 @@ drm_clflush_page(struct page *page)
 
 	page_virtual = kmap_atomic(page);
 	for (i = 0; i < PAGE_SIZE; i += size)
-		clflush(page_virtual + i);
+		clflushopt(page_virtual + i);
 	kunmap_atomic(page_virtual);
 }
 
-- 
1.7.10.4


  parent reply	other threads:[~2014-02-26 19:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-26 19:06 [PATCH 0/4] x86: Add and use support for clflushopt Ross Zwisler
2014-02-26 19:06 ` [PATCH 1/4] x86: Add " Ross Zwisler
2014-02-27 16:27   ` [tip:x86/cpufeature] x86: Add support for the clflushopt instruction tip-bot for Ross Zwisler
2014-02-26 19:06 ` [PATCH 2/4] x86: Use clflushopt in clflush_cache_range Ross Zwisler
2014-02-27 16:30   ` [tip:x86/cpu] " tip-bot for Ross Zwisler
2014-02-26 19:06 ` Ross Zwisler [this message]
2014-02-27 16:30   ` [tip:x86/cpu] x86: Use clflushopt in drm_clflush_page tip-bot for Ross Zwisler
2014-02-26 19:06 ` [PATCH 4/4] x86: Use clflushopt in drm_clflush_virt_range Ross Zwisler
2014-02-27 16:30   ` [tip:x86/cpu] " tip-bot for Ross Zwisler

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=1393441612-19729-4-git-send-email-ross.zwisler@linux.intel.com \
    --to=ross.zwisler@linux.intel.com \
    --cc=h.peter.anvin@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@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

Powered by JetHome