From: Dan Cross <crossd@gmail.com>
To: 9fans <9fans@9fans.net>
Subject: Re: mmaping on plan9? (was Re: [9fans] venti /plan9port mmapped
Date: Wed, 11 Feb 2026 20:36:27 -0500 [thread overview]
Message-ID: <CAEoi9W4yiG4L9VSfGyNK4r_6Rgc-xiGQe7CbjPF0Cw8drt=0HQ@mail.gmail.com> (raw)
In-Reply-To: <CAFSF3XNViT61F7KeDCNmFgLWt5Gdti9tjViHfvjMJhOM+w1kXw@mail.gmail.com>
On Wed, Feb 11, 2026 at 10:36 AM hiro <23hiro@gmail.com> wrote:
> i'm not sure i understand even the most abstract topic discussed here, what's the advantage of logically organizing your data in size constrained unnamed page tables as opposed to files in a named tree?
You don't. You're still using named files; this affects how you access
them: does that look like loads and stores from and to memory, or does
it look like explicit system calls a la `read` and `write`?
> in the end you are assuming your memloads are not gonna be translated into some message passing protocol underneath? are you sure you can treat all your big data like one continuous memory region?
Depends on the data. For the sorts of things we're talking about with
`mmap`, you open a file, and then you map some region within the file
to some part of your address space; you don't have to map the whole
thing, just the part you're interested in. If it doesn't fit, you get
an error.
> "The main benefits of mmap are reduced initial latency" -> latency from where to where? what kind information are you transmitting in that procedure?
Latency from time of `exec` to running the new program, usually.
There are kind of two ways to do it; when you load a binary, you could
read all of the bits of it out of the binary executable image and
eagerly copy them into memory, but that might take a while if the
executable is big. But once you're done, you start it running, and if
it ever faults that's probably an error, so you just kill it.
Or, you can read the relatively small headers at the front of the
binary, and use that information to reserve regions of address space
and their properties, and figure out where the program is supposed to
start executing. Then you just start trying to run, without reading
anything else. But, that's going to page fault pretty much
immediately, like on the first instruction. So you can arrange for the
fault handler to detect that the fault was in a mapped, but
unpopulated, region of memory, read the relevant page of memory from
the underlying executable file, patch that into the address space, and
then return to userspace and restart the faulting instruction, which
probably fault now (one of its operands might refer to still unmapped
memory). But the program will probably do something that will fault
again soon, at which point you just repeat the same process. You keep
doing that until the program exits or you detect a fault for something
outside of the program's mapped regions, or that perhaps in one of
those regions but in violation of the region's permissions (a store to
a read-only segment or something similar). This is "demand paging" in
a nutshell.
> what concrete problem are you trying to solve?
I can't speak to that, I'm afraid.
- Dan C.
> On Wed, Feb 11, 2026 at 4:34 AM Ori Bernstein <ori@eigenstate.org> wrote:
>>
>> On Tue, 10 Feb 2026 05:13:47 -0500
>> "Alyssa M via 9fans" <9fans@9fans.net> wrote:
>>
>> > On Monday, February 09, 2026, at 3:24 PM, ron minnich wrote:
>> > > as for mmap, there's already a defacto mmap happening for executables. They are not read into memory. In fact, the first instruction you run in a binary results in a page fault.
>> > I thinking one could bring the same transparent/defacto memory mapping to read(2) and write(2), so the API need not change at all.
>>
>> That gets... interesting, from an FS semantics point of view.
>> What does this code print? Does it change with buffer sizes?
>>
>> fd = open("x", ORDWR);
>> pwrite(fd, "foo", 4, 0);
>> read(fd, buf, 4);
>> pwrite(fd, "bar", 4, 0);
>> print("%s\n", buf);
>>
>
> 9fans / 9fans / see discussions + participants + delivery options Permalink
------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/Te8d7c6e48b5c075b-M1e5415ad20881dd5ef3e0d59
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription
next prev parent reply other threads:[~2026-02-12 4:08 UTC|newest]
Thread overview: 92+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-02 19:54 [9fans] venti /plan9port mmapped wb.kloke
2026-01-02 20:39 ` ori
2026-01-02 20:58 ` Bakul Shah via 9fans
2026-01-06 22:59 ` Ron Minnich
2026-01-07 4:27 ` Noam Preil
2026-01-07 6:15 ` Shawn Rutledge
2026-01-07 15:46 ` Persistent memory (was Re: [9fans] venti /plan9port mmapped) arnold
2026-01-07 16:11 ` Noam Preil
2026-01-07 17:26 ` Wes Kussmaul
2026-01-07 8:52 ` [9fans] venti /plan9port mmapped wb.kloke
2026-01-07 16:30 ` mmaping on plan9? (was " Bakul Shah via 9fans
2026-01-07 16:40 ` Noam Preil
2026-01-07 16:41 ` ori
2026-01-07 20:35 ` Bakul Shah via 9fans
2026-01-07 21:31 ` ron minnich
2026-01-08 7:56 ` arnold
2026-01-08 10:31 ` wb.kloke
2026-01-09 0:02 ` ron minnich
2026-01-09 3:57 ` Paul Lalonde
2026-01-09 5:10 ` ron minnich
2026-01-09 5:18 ` arnold
2026-01-09 6:06 ` David Leimbach via 9fans
2026-01-09 17:13 ` ron minnich
2026-01-09 17:39 ` tlaronde
2026-01-09 19:48 ` David Leimbach via 9fans
2026-02-05 21:30 ` Alyssa M via 9fans
2026-02-08 14:18 ` Ethan Azariah
2026-02-08 15:10 ` Alyssa M via 9fans
2026-02-08 20:43 ` Ethan Azariah
2026-02-09 1:35 ` ron minnich
2026-02-09 15:23 ` ron minnich
2026-02-09 17:13 ` Bakul Shah via 9fans
2026-02-09 21:38 ` ron minnich
2026-02-10 10:13 ` Alyssa M via 9fans
2026-02-11 1:43 ` Ron Minnich
2026-02-11 2:19 ` Bakul Shah via 9fans
2026-02-11 3:21 ` Ori Bernstein
2026-02-11 10:01 ` hiro
2026-02-12 1:36 ` Dan Cross [this message]
2026-02-12 5:39 ` Alyssa M via 9fans
2026-02-12 9:08 ` hiro via 9fans
2026-02-12 13:34 ` Alyssa M via 9fans
2026-02-13 13:48 ` hiro
2026-02-13 17:21 ` ron minnich
2026-02-15 16:12 ` Danny Wilkins via 9fans
2026-02-17 3:13 ` Alyssa M via 9fans
2026-02-17 13:02 ` Dan Cross
2026-02-17 16:00 ` ron minnich
2026-02-17 16:39 ` hiro
2026-02-17 16:56 ` Bakul Shah via 9fans
2026-02-17 17:54 ` hiro
2026-02-17 22:21 ` Alyssa M via 9fans
2026-02-16 2:24 ` Alyssa M via 9fans
2026-02-16 3:17 ` Ori Bernstein
2026-02-16 10:55 ` Frank D. Engel, Jr.
2026-02-16 13:49 ` Ori Bernstein
2026-02-16 19:40 ` Bakul Shah via 9fans
2026-02-16 19:43 ` Bakul Shah via 9fans
2026-02-16 9:50 ` tlaronde
2026-02-16 12:24 ` hiro via 9fans
2026-02-16 12:33 ` hiro via 9fans
2026-02-11 14:22 ` Dan Cross
2026-02-11 18:44 ` Ori Bernstein
2026-02-12 1:22 ` Dan Cross
2026-02-12 4:26 ` Ori Bernstein
2026-02-12 4:34 ` Dan Cross
2026-02-12 3:12 ` Alyssa M via 9fans
2026-02-12 4:52 ` Dan Cross
2026-02-12 8:37 ` Alyssa M via 9fans
2026-02-12 12:37 ` hiro via 9fans
2026-02-13 1:36 ` Dan Cross
2026-02-14 3:35 ` Alyssa M via 9fans
2026-02-14 14:26 ` Dan Cross
2026-02-15 4:34 ` Bakul Shah via 9fans
2026-02-15 10:19 ` hiro
2026-02-10 16:49 ` wb.kloke
2026-02-08 14:08 ` Ethan Azariah
2026-01-07 21:40 ` ori
2026-01-07 16:52 ` ori
2026-01-07 17:37 ` wb.kloke
2026-01-07 17:46 ` Noam Preil
2026-01-07 17:56 ` wb.kloke
2026-01-07 18:07 ` Noam Preil
2026-01-07 18:58 ` wb.kloke
2026-01-07 14:57 ` Thaddeus Woskowiak
2026-01-07 16:07 ` Wes Kussmaul
2026-01-07 16:22 ` Noam Preil
2026-01-07 17:31 ` Wes Kussmaul
2026-01-07 16:13 ` Noam Preil
2026-01-02 21:01 ` ori
2026-01-08 15:59 ` wb.kloke
2026-02-11 23:19 ` red
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAEoi9W4yiG4L9VSfGyNK4r_6Rgc-xiGQe7CbjPF0Cw8drt=0HQ@mail.gmail.com' \
--to=crossd@gmail.com \
--cc=9fans@9fans.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).