Skip to content

Commit

Permalink
x86: Use clflushopt in drm_clflush_page
Browse files Browse the repository at this point in the history
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>
Link: http://lkml.kernel.org/r/1393441612-19729-4-git-send-email-ross.zwisler@linux.intel.com
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
  • Loading branch information
Ross Zwisler authored and H. Peter Anvin committed Feb 27, 2014
1 parent 8b80fd8 commit 2a0c772
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/gpu/drm/drm_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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);
}

Expand Down

0 comments on commit 2a0c772

Please sign in to comment.