Re: Mmap device performance

Linus Torvalds (torvalds@transmeta.com)
11 Dec 1997 18:27:10 GMT


In article <19971210092943.51142@jolt>, Daryll Strauss <daryll@d2.com> wrote:
>
>On the PPro and PII boxes the performance is roughly half what it is
>under Windows. Since the application is identical, and the interface to
>the card is simply writing to a memory mapped region so it seems that
>the degradation must be happening somewhere in the kernel layers. I'm
>currently mapping the region shared with read/write access.

One thing to look out for is the "memory type registers" on the PPro and
the PII. Somebody had a kernel loadable module to read and set the
registers, it may be that your windows setup has a different memory type
setup than the Linux setup.

Similarly, when you do the mapping, look into the effects of the "cache
disable" and "write-through" bits in the page tables. You mention that
you copied the code from the /dev/mem map code, and that code does:

#if defined(__i386__)
/*
* hmm.. This disables high-memory caching, as the XFree86 team
* wondered about that at one time.
* The surround logic should disable caching for the high device
* addresses anyway, but right now this seems still needed.
*/
if (x86 > 3 && offset >= __pa(high_memory))
pgprot_val(vma->vm_page_prot) |= _PAGE_PCD;
#endif

the code _shouldn't_ make any difference (as per the comment), but
depending on how the card works it might.

Linus