how does one disable processor cache on memory allocated with get_free_pages?
I am writing a kernel module that is allocating memory using get_free_pages. It is important that access to/from these pages not use the processor (Pentium 4) cache. How can I do this?
I have looked at drivers/char/mem.c which uses a pgprot_noncached function to modify the vm_page_prot attribute of a vma during a mmap call. If I understand this correctly, this would make sure that all access to the pages that are done through the mapping will not be cached.
This will not work for me, however, because I need to access this memory from the device driver independent of any user code that might mmap it. I thought of the device driver open'ing and mmap'ing itself but it doesn't have a special file in the file system (I am not using DEVFS) and this seems kludgy.
I am hoping that there is a way to simply modify the page table entries for the allocated pages. Is there?
If so, what is the mechanism for modifying the entries and synchronizing the configuration with the processor cache?
Please CC any response directly to me ([email protected]).
Thanks!