Skip to contentSkip to conversation

Adjust cache settings of user pages?

DISCUSSION Bill Gatliff 1 participant 2 messages Sep 22, 2009 – Sep 25, 2009

lore
Share & tools
lore
#0 lore raw

Guys:

I'm using get_user_pages() to let me "stream" data directly from a hardware device to the user application that wants it. (The device in question is an SPI device, and I use the user pages as the receive buffer).

In the abstract, everything I have is working fine. However, users are wanting to read the data immediately as soon as they know that the data is there. What I'm finding is that even though I've sent them such indication (via a blocking read()), the data in question might not have actually gotten placed into the user buffer at that point--- probably because the pages are still in the cache? (The data does eventually show up).

What the right API is (if there is one) to tell the kernel to turn off caching for a user page--- or even if such a thing is possible. Can anyone offer any hints?

Thanks!

b.g.

Signature · 2 lines
Bill Gatliff
bgat at billgatliff.com
#1 lore raw
Quoted 8 lines · Bill Gatliff

Guys:

What the right API is (if there is one) to tell the kernel to turn off caching for a user page--- or even if such a thing is possible. Can anyone offer any hints?

Nevermind.

In hindsight, what I'm really doing is a kind of DMA, right? That means I have to use those APIs and not just the plain old get_user_pages(). Problem resolved.

Move along, nothing more to see here. :)

b.g.

Signature · 2 lines
Bill Gatliff
bgat at billgatliff.com