Messages in this thread | | | From | Jakub Jelinek <> | Subject | Re: MM with fragmented memory | Date | Thu, 22 Oct 1998 11:45:33 +0200 (MET DST) |
| |
> I can see two viable approaches: > > (1) play linker tricks and insert holes in the kernel such that it skips > over the gaps in memory. Then map all the memory 1:1 and let > start_mem and end_mem each have one of the 512kB fragments for > linear allocation.
I think if you have just 512kB fragments, it would be a lot of trouble with linker, I guess you'd need to touch generic code in a couple of places, etc. BTW: Are those frags at fixed locations or do their addresses depend on how somebody stuffed SIMMs into it? Another question: how large VA space do you have and how large PA space the machine has? 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). If that's possible, then you won. In fact, that's how things look like on sparc64: physical memory may be non-contiguous, may start anywhere and consists of chunks at least 4M long. We have an automatic mapping VA=PA+PAGE_OFFSET. The kernel is located in first physical chunk, which is mapped with a 4M page to 4MB VA. The kernel already has PG_Skip stuff which is designed for non-contiguous physical memory (ie. your mem_map will point to some valid pages and some invalid pages (as no physical pages is mapped to them).
> (2) use the MMU to create virtually continuous memory and let the kernel > manage that in the usual way.
If the above is not possible, then this should work just fine, although a tiny bit slower. That's what sparc32/sun4m does in most cases, so the little voice can stay back in your head, such scheme is tested and works.
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/
| |