Subject: RE: mmap'ed memory cacheable or uncheable

From: "Teresa Tao" <[email-masked]>
Date: Fri, 25 Jul 2003 15:52:33 -0700

How about if I specify the following flags in my mmap routine just like what the pgprot_noncached micro did.
	pgprot_val(vma->vm_page_prot) &= ~_CACHE_MASK;
	pgprot_val(vma->vm_page_prot) |= _CACHE_UNCACHED;

Will this have kernel make the mmap'd memory non-cacheable? Or is there a mmap non-cacheable patch?

Thanks in advance!

Teresa

-----Original Message-----
From: Jun Sun [mailto:[email-masked]]
Sent: Friday, July 25, 2003 3:02 PM
To: Teresa Tao
Cc: [email-masked]; [email-masked]
Subject: Re: mmap'ed memory cacheable or uncheable

On Thu, Jul 24, 2003 at 08:26:59PM -0700, Teresa Tao wrote:
> Hi there,
> 
> I got a question regarding the mmap'ed memory. Is the mmap'ed memory cacheable or uncheable? My driver just use the remap_page_range to map a reserved physical memory.
>

I am pretty much sure it is cached, although I can't pin down exactly
where in the mm subsystem it does so - I have had cache bugs related
to mmap().

Jun

---

From: Jun Sun <[email-masked]>
Date: Mon, 28 Jul 2003 14:24:01 -0700

> Will this have kernel make the mmap'd memory non-cacheable? Or is there a mmap non-cacheable patch?

I think this might work.  Did you try it?  The performance will be bad
though as mmap() is used widely by userland.

Jun

---

From: "Maciej W. Rozycki" <[email-masked]>
Date: Tue, 29 Jul 2003 18:09:43 +0200 (MET DST)

> though as mmap() is used widely by userland.

 See mmap_mem() for how to select between cached and uncached mmap()ing
cleanly. 

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: [email-masked], PGP key available        +