lkml.org 
[lkml]   [2001]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Caches, page coloring, virtual indexed caches, and more
Ralf Baechle wrote:
> > mremap. Linux specific but pretty much the same as mmap, but easier.
> > We just enforce that the virtual address of the source of mremap,
> > and the destination of mremap match on VIRT_INDEX_BITS.
>
> Correct and as mremap doesn't take any address argument we won't break
> any expecations on the properties of the returned address in mmap.

See MREMAP_FIXED. There is an address argument, not mentioned in the
manpage (man-pages 1.30).

> > Hmm. This doesn't sound right. And this sounds like a silly way to
> > use reverse mappings anyway, since you can do it up front in mmap and
> > their kin. Which means you don't have to slow any of the page fault
> > logic up.
>
> Then how do you handle something like:
>
> fd = open(TESTFILE, O_RDWR | O_CREAT, 664);
> res = write(fd, one, 4096);
> mmap(addr , PAGE_SIZE, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
> mmap(addr + PAGE_SIZE, PAGE_SIZE, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
>
> If both mappings are immediately created accessible you'll directly endup
> with aliases. There is no choice, if the pagesize is only 4kb an R4x00
> will create aliases in the case. Bad.

Indeed, a particularly nice way to handle circular buffers for DSP
algorithms provided it works :-)

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

\
 
 \ /
  Last update: 2005-03-22 13:17    [W:0.068 / U:8.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site