mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* PAGE_CACHE_WC strikes again
@ 2009-04-01  0:10 Eric Anholt
  2009-04-01  0:14 ` Jesse Barnes
  0 siblings, 1 reply; 11+ messages in thread
From: Eric Anholt @ 2009-04-01  0:10 UTC (permalink / raw)
  To: lkml, Venkatesh Pallipadi

[-- Attachment #1: Type: text/plain, Size: 1562 bytes --]

I just tracked down what was cutting performance 10x on one of my
systems on a microbenchmark I'd just written:

--- a/drivers/gpu/drm/drm_gem.c
+++ b/drivers/gpu/drm/drm_gem.c
@@ -540,7 +540,7 @@ int drm_gem_mmap(struct file *filp, struct
vm_area_struct *vma)
 	/* FIXME: use pgprot_writecombine when available */
 	prot = pgprot_val(vma->vm_page_prot);
 #ifdef CONFIG_X86
-	prot |= _PAGE_CACHE_WC;
+	/*prot |= _PAGE_CACHE_WC;*/
 #endif
 	vma->vm_page_prot = __pgprot(prot);
 
Turns out that setting PAGE_CACHE_WC disables the WC effect of the MTRR
on my non-PAT (disabled due to CPU errata) 945GM system, and this
workaround took GTT-mapped writes from 120MB/s to 1180MB/s.

What's the right way to be setting our PTEs?  This is similar to the
workaround in ef5fa0ab24b87646c7bc98645acbb4b51fc2acd4, but to do it in
the driver as well means exporting pat_enabled, and it really seems like
PAT presence shouldn't be something the driver has to worry about --
I've got a WC MTRR and I'm asking for a WC mapping and I'm getting
uncached.  If I failed to init the MTRR, the state of the aperture I'm
mapping would be uncached.

Test code is at
git://anongit.freedesktop.org/git/xorg/app/intel-gpu-tools
under benchmarks/intel_upload_blit_large_gtt but requires libdrm master
until we get a release out in the next week or so.  Also includes a few
standalone regression tests, which may be useful for people making
changes that may affect i915.

-- 
Eric Anholt
eric@anholt.net                         eric.anholt@intel.com



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2009-04-01  3:18 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-01  0:10 PAGE_CACHE_WC strikes again Eric Anholt
2009-04-01  0:14 ` Jesse Barnes
2009-04-01  0:29   ` Pallipadi, Venkatesh
2009-04-01  0:49     ` Jesse Barnes
2009-04-01  1:03     ` Suresh Siddha
2009-04-01  1:12       ` Jesse Barnes
2009-04-01  1:30         ` Suresh Siddha
2009-04-01  1:57           ` Jesse Barnes
2009-04-01  3:18             ` Dave Airlie
2009-04-01  3:17         ` Pallipadi, Venkatesh
2009-04-01  1:22       ` Jesse Barnes

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