how does one disable processor cache on memory allocated with get_free_pages?

From: Ross Tyler
Date: Wed Feb 25 2004 - 18:46:19 EST


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 (retyler@xxxxxxxxxxxx).

Thanks!

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/