so, if you want to try the effect of just reading in text and data segments, rather than faulting them in, this is actually pretty easy. It's what we did in NIX. Look in the NIX source for nixprepage, and then see how we applied it in sysexec, this is a pretty quick test you can make.
Have it enabled depending on a kernel variable, similarly pretty quick, Let me know if you need more pointers. Then you need to figure out how to measure the effect. A possible simple way is to see the effect on building a kernel. It won't matter much at all for long running processes, so you want to look for something that involves lots of exec. As for needing or not needing mmap, you need to consider how you support efficient access for files 100x or greater in size than physical memory. I'm not sure what your plan is there. It's a real world problem however. Or, further, files that contain data which are pointers. On Thu, Feb 12, 2026 at 8:17 PM Alyssa M via 9fans <[email protected]> wrote: > On Thursday, February 12, 2026, at 9:08 AM, hiro wrote: > > you're saying you want the software to be more simple, but at the same > time you say you want to exploit some techniques that make the hardware use > more efficient. > the first goal is commendable, but for the second you have to first > understand how the hardware actually works. i suggest you share the insight > that makes you believe mmap is "more efficient" than reading a large file. > > I don't think it is, and I don't think I ever said it was more efficient, > did I? > I think having the whole file in your address space makes it easier to > select the bits of the file you want to read - assuming you don't need to > read all or even most of it. > Being that selective probably only makes a significant speed difference > when the file is large, anyway. > > I've built a couple of simple disk file systems. I thinking of taking the > cache code out of one of them and mapping the whole file system image into > the address space - to see how much it simplifies the code. I'm not > expecting it will be faster. > > On Thursday, February 12, 2026, at 12:38 PM, hiro wrote: > > If you poke at it sparsely then reading it into memory is what you should > avoid, thus you use seek and normal read instead. that is more simple, > efficient, optimal. > > I'm sure that's been argued to death over the years. But in a lot of > situations I'd agree with you. It's going to be a tradeoff. > > My interest is in simpler software - so I'm exploring a way get some of > the effect of mmap without having actual mmap - by making it an > implementation detail. > *9fans <https://9fans.topicbox.com/latest>* / 9fans / see discussions > <https://9fans.topicbox.com/groups/9fans> + participants > <https://9fans.topicbox.com/groups/9fans/members> + delivery options > <https://9fans.topicbox.com/groups/9fans/subscription> Permalink > <https://9fans.topicbox.com/groups/9fans/Te8d7c6e48b5c075b-Mdbd5febf25c74da357aee4b1> > ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/Te8d7c6e48b5c075b-M1b18a0b65f9e2407978304b0 Delivery options: https://9fans.topicbox.com/groups/9fans/subscription
