Re: MM with fragmented memory

Jakub Jelinek (jj@sunsite.ms.mff.cuni.cz)
Thu, 22 Oct 1998 12:33:17 +0200 (MET DST)


> > If e.g. max PA range is 2GB, but VA is 4GB, then you could
> > happily use 1:(1+off) mapping (or even 1:1), and map the kernel with a
> > virtual mapping to some other VA (so that kernel's 2MB (or so) would have
> > two mappings).
>
> Hmm, that's a very interesting idea ! There's one issue with multiple
> mappings, though: the cache works with virtual addresses, so if we
> access the same page via two different addresses, our cache becomes
> inconsistent. Can such a thing ever happen to kernel text, data, bss,
> and friends ?

Ok, just make sure you don't access the same thing with two mappings. That's
easy. In paging_init/mem_init, things which need to be alloced before them
go still into the kernel trunk, then you page align your current start_mem
pointer and from that place on, you access everything with the high
addresses (by high I mean PA+PAGE_OFFSET, low are KERNELBASE+something).
In mem_map, all kernel pages will be reserved anyway, so nobody will try to
use them and look at them with another pointer.
The only issue to be solved (and that applies to sparc32/sparc64), is knfsd,
which needs some way how to ensure a VA between PAGE_OFFSET and end_mem is
valid. That, I think, should be done by some arch specific macros (on intel
& co. it would always return "valid"), which would look up some bit field.

Cheers,
Jakub
___________________________________________________________________
Jakub Jelinek | jj@sunsite.mff.cuni.cz | http://sunsite.mff.cuni.cz
Administrator of SunSITE Czech Republic, MFF, Charles University
___________________________________________________________________
Ultralinux - first 64bit OS to take full power of the UltraSparc
Linux version 2.1.125 on a sparc64 machine (498.80 BogoMips).
___________________________________________________________________

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