modify the cache-inhibit and guard bits from userspace?
We're running a dual-970 blade, based on a modified 2.6.10.
We have an application that does lots of random data fetches over a fairly large data set (a few GB) contained entirely in RAM, and the performance guys think that we may be spending time in unnecessary hardware prefetches and would like me to provide them a mechanism to individually specify the cache-inhibited and guard bits from userspace so that they can try to fine-tune their performance.
What's the most logical way for me to do this? Do I extend mprotect() to support additional flags?
Has anyone done this before? I didn't find anything in google. Currently the guard bit seems to only be used for ioremap() and in __pci_mmap_set_pgprot() if the memory doesn't support write combining.
Thanks,
Chris
Am Dienstag 15 November 2005 22:16 schrieb Christopher Friesen:
Quoted 6 lines
What's the most logical way for me to do this? =A0Do I extend
mprotect()to support additional flags?Has anyone done this before? =A0I didn't find anything in google. Currently the guard bit seems to only be used for
ioremap()and in__pci_mmap_set_pgprot()if the memory doesn't support write combining.
I have seen an earlier patch that modifies madvise to do this, which seems a little saner than mprotect, although they can probably both be implemented in a similar way.
Alternatively, you could write a new file system similar to hugetlbfs and s= et=20
the cache-inhibit bit in its mmap function.
Arnd <><
Quoted 3 lines · Arnd Bergmann
I have seen an earlier patch that modifies madvise to do this, which seems a little saner than mprotect, although they can probably both be implemented in a similar way.
Ah, that would make sense. It does fit the intent of the function a bit better.
Quoted 1 line
Alternatively, you could write a new file system similar to hugetlbfs and set the cache-inhibit bit in its mmap function.
Also a possibility. I think the madvise method is a bit cleaner for the apps.
Chris