mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Mapping PCI BAR through /sys/devices/pci* sets cache-disable and write-through
@ 2008-04-16 17:40 Keith Packard
  2008-04-16 22:23 ` Mapping PCI BAR through /sys/devices/pci* sets cache-disable andwrite-through Pallipadi, Venkatesh
  0 siblings, 1 reply; 5+ messages in thread
From: Keith Packard @ 2008-04-16 17:40 UTC (permalink / raw)
  To: linux-kernel

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

The X server recently (within the last year) switched from mapping the
frame buffer from /dev/mem to using /sys/devices/pci*. This caused a
significant memory bandwidth reduction for writes, similar to the effect
caused when the associated MTRR is set to UC instead of WC.

Looking at the code path, we find, in i386:pci_mmap_page_range:

        prot = pgprot_val(vma->vm_page_prot);
        if (boot_cpu_data.x86 > 3)
                prot |= _PAGE_PCD | _PAGE_PWT;
        vma->vm_page_prot = __pgprot(prot);

Which is to say, on any CPU which supports it, force the cache-disable
and write-through bits on.

Is there some reason this is there? Surely applications should be
expected to set these attributes correctly, currently using MTRR and in
the future, using PAT directly.

-- 
keith.packard@intel.com

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

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

end of thread, other threads:[~2008-04-17 17:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-16 17:40 Mapping PCI BAR through /sys/devices/pci* sets cache-disable and write-through Keith Packard
2008-04-16 22:23 ` Mapping PCI BAR through /sys/devices/pci* sets cache-disable andwrite-through Pallipadi, Venkatesh
2008-04-17  5:20   ` Keith Packard
2008-04-17 13:14     ` Mapping PCI BAR through /sys/devices/pci* sets cache-disableandwrite-through Pallipadi, Venkatesh
2008-04-17 17:07       ` 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