[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-2a0c772f1967565d5b71a98012e74d5a7bddc1c4@git.kernel.org>
Date: Thu, 27 Feb 2014 08:30:38 -0800
From: tip-bot for Ross Zwisler <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...nel.org,
ross.zwisler@...ux.intel.com, tglx@...utronix.de,
hpa@...ux.intel.com
Subject: [tip:x86/cpu] x86: Use clflushopt in drm_clflush_page
Commit-ID: 2a0c772f1967565d5b71a98012e74d5a7bddc1c4
Gitweb: http://git.kernel.org/tip/2a0c772f1967565d5b71a98012e74d5a7bddc1c4
Author: Ross Zwisler <ross.zwisler@...ux.intel.com>
AuthorDate: Wed, 26 Feb 2014 12:06:51 -0700
Committer: H. Peter Anvin <hpa@...ux.intel.com>
CommitDate: Thu, 27 Feb 2014 08:26:20 -0800
x86: Use clflushopt in drm_clflush_page
If clflushopt is available on the system, use it instead of clflush in
drm_clflush_page.
Signed-off-by: Ross Zwisler <ross.zwisler@...ux.intel.com>
Link: http://lkml.kernel.org/r/1393441612-19729-4-git-send-email-ross.zwisler@linux.intel.com
Signed-off-by: H. Peter Anvin <hpa@...ux.intel.com>
---
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);
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists