Re: Cache incoherencies (WAS: New resources - pls, explain :-( )

Benjamin Herrenschmidt (bh40@calva.net)
Thu, 26 Aug 1999 12:03:05 +0200


On Wed, Aug 25, 1999, Philip Blundell <Philip.Blundell@pobox.com> wrote:

>What I'd do is extend alloc_area_pmd, alloc_area_pte and so on to take an
>extra argument to be the page protection value. The normal vmalloc can pass
>this in as just PAGE_KERNEL, and your new vmalloc_uncached can use some
>appropriate variant.

I wanted to avoid changing the non-arch specific code, but I beleive this
is the best way to do. We could define a generic GPF_UNCACHED flag too,
so this would make it useable with kmalloc too. This will be useful for
other non-coherent archs (like PowerMac Nubus).

>>or can I just alloc the area and then make pages non-cachable using
>>pte_modify afterwards ? In this case I'm not sure how to walk the PTEs...
>
>You *could* do it this way, but I don't think it's such a good idea.

I don't think neither.

>>Also alloc_are_pte makes several calls to __get_free_page, so I beleive
>>there's no way to make sure they are physically contiguous, is there ?
>
>No. This is always the case with vmalloc.

Ok. So I'll implement GPF_UNCACHED, and vmalloc_unached will simply pass
this instead of GPF_KERNEL. This way, we can have both vmalloc_uncached
and kmalloc(xxx, GPF_UNCACHED).

I'll also add a #define for the cache line size in asm/io.h and a function:

pci_device_is_cache_coherent(struct pcidev *dev)

which will hard-return true on coherent archs.

Linus, are you ok with that ?

-- 
           Perso. e-mail: <mailto:bh40@calva.net>
           Work   e-mail: <mailto:benh@mipsys.com>
BenH.      Web   : <http://calvaweb.calvacom.fr/bh40/>

- 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/