Re: Cache incoherencies

Rogier Wolff (R.E.Wolff@BitWizard.nl)
Thu, 26 Aug 1999 13:46:50 +0200 (MEST)


Philip Blundell wrote:
> >There isn't a portable way to get uncached memory. But GFP_UNCACHED
> >sounds good.
>
> It sounds good but conceptually I don't like it. Making a page uncached
> involves messing with the pagetables and perhaps creating a completely new
> mapping. This isn't something that __get_free_pages should be doing in my
> opinion. I would prefer people to allocate pages using
> __get_free_pages(GFP_KERNEL) and then create an uncached mapping using some
> other function, or perhaps do both in one go using a vmalloc variant.

On the other hand, having __get_free_pages allow for various
attributes that belong to pages would be a good idea. It should for
example allow you to specify that you require a DMA-able page on a PC.
(You're all thinking about pages below 16M, right? Good. I was talking
about pages below 4G for a PCI bus-mastering card...)

As a user of __get_free_pages or kmalloc, you should be able to specify
"I NEED DMA" or "I prefer non-DMA".

__get_free_pages should call an "exception" routine when it gets "none
available" on a request. This will happen if no "flagged as
uncacheable" pages happen to be free, and the exception routine will
map a page uncacheable, and return that. The exception routine for
"normal" pages may look to see if there are any free uncached pages
and claim them back...

Roger.

-- 
** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2137555 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
------ Microsoft SELLS you Windows, Linux GIVES you the whole house ------

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