diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-03-02 05:00:57 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-03-02 05:06:49 -0500 |
commit | f180053694b43d5714bf56cb95499a3c32ff155c (patch) | |
tree | 00286fcc88d2842629b039da4009a1332b3a1719 /drivers/gpu | |
parent | 34754b69a6f87aa6aa2860525a82f12532f83afd (diff) |
x86, mm: dont use non-temporal stores in pagecache accesses
Impact: standardize IO on cached ops
On modern CPUs it is almost always a bad idea to use non-temporal stores,
as the regression in this commit has shown it:
30d697f: x86: fix performance regression in write() syscall
The kernel simply has no good information about whether using non-temporal
stores is a good idea or not - and trying to add heuristics only increases
complexity and inserts fragility.
The regression on cached write()s took very long to be found - over two
years. So dont take any chances and let the hardware decide how it makes
use of its caches.
The only exception is drivers/gpu/drm/i915/i915_gem.c: there were we are
absolutely sure that another entity (the GPU) will pick up the dirty
data immediately and that the CPU will not touch that data before the
GPU will.
Also, keep the _nocache() primitives to make it easier for people to
experiment with these details. There may be more clear-cut cases where
non-cached copies can be used, outside of filemap.c.
Cc: Salman Qazi <sqazi@google.com>
Cc: Nick Piggin <npiggin@suse.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 6b209db8370d..818576654092 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -215,7 +215,7 @@ fast_user_write(struct io_mapping *mapping, | |||
215 | 215 | ||
216 | vaddr_atomic = io_mapping_map_atomic_wc(mapping, page_base); | 216 | vaddr_atomic = io_mapping_map_atomic_wc(mapping, page_base); |
217 | unwritten = __copy_from_user_inatomic_nocache(vaddr_atomic + page_offset, | 217 | unwritten = __copy_from_user_inatomic_nocache(vaddr_atomic + page_offset, |
218 | user_data, length, length); | 218 | user_data, length); |
219 | io_mapping_unmap_atomic(vaddr_atomic); | 219 | io_mapping_unmap_atomic(vaddr_atomic); |
220 | if (unwritten) | 220 | if (unwritten) |
221 | return -EFAULT; | 221 | return -EFAULT; |