From: "David Leimbach via 9fans" <9fans@9fans.net>
To: 9fans <9fans@9fans.net>
Cc: 9fans <9fans@9fans.net>
Subject: Re: mmaping on plan9? (was Re: [9fans] venti /plan9port mmapped
Date: Fri, 9 Jan 2026 11:48:13 -0800 [thread overview]
Message-ID: <A70800B2-5651-4B2F-A475-D6F3F214EBBB@icloud.com> (raw)
In-Reply-To: <aWE9PvOfXBAORtGw@kergis.com>
Sent from my iPhone
> On Jan 9, 2026, at 9:57 AM, tlaronde@kergis.com wrote:
>
> On Thu, Jan 08, 2026 at 10:06:26PM -0800, David Leimbach via 9fans wrote:
>> I?d been impressed by L4. It?s certainly been deployed pretty broadly.
>>
>
> Was not L4 rewritten in assembly for performance purposes?
>
> T. Laronde
The opposite. L3 was assembly. L4 is basically a spec now. Many implementations. C and C++ (and Haskell I believe)
My point was you can do recursive paging. It has been shown.
>> And it has recursive pagers but ? not sure how that?s used in practice.
>>
>> And there are a bunch of variants.
>> Sent from my iPhone
>>
>>>> On Jan 8, 2026, at 9:23?PM, arnold@skeeve.com wrote:
>>>
>>> ?I vaguely remember someone being quoted as saying
>>>
>>> Microkernels don't have to be small. They just have to
>>> not do much.
>>>
>>> :-)
>>>
>>> ron minnich <rminnich@gmail.com> wrote:
>>>
>>>> I would not tar the idea of external pagers with the Mach tarbrush. Mach
>>>> was pretty much inefficient at everything, including external pagers.
>>>> External pagers can work well, when implemented well.
>>>>
>>>>> On Thu, Jan 8, 2026 at 8:41?PM Paul Lalonde <paul.a.lalonde@gmail.com>
>>>>> wrote:
>>>>>
>>>>> Did the same on GPUs/Xeon Phi, including in the texture units. Very
>>>>> useful mechanism for abstracting compute with random access characteristics.
>>>>>
>>>>> Paul
>>>>>
>>>>>> On Wed, Jan 7, 2026, 1:35?p.m. ron minnich <rminnich@gmail.com> wrote:
>>>>>> what we had planned for harvey was a good deal simpler: designate a part
>>>>>> of the address space as a "bounce fault to user" space area.
>>>>>>
>>>>>> When a page fault in that area occurred, info about the fault was sent to
>>>>>> an fd (if it was opened) or a note handler.
>>>>>>
>>>>>> user could could handle the fault or punt, as it saw fit. The fixup was
>>>>>> that user mode had to get the data to satisfy the fault, then tell the
>>>>>> kernel what to do.
>>>>>>
>>>>>> This is much like the 35-years-ago work we did on AIX, called
>>>>>> external pagers at the time; or the more recent umap work,
>>>>>> https://computing.llnl.gov/projects/umap, used fairly widely in HPC.
>>>>>>
>>>>>> If you go this route, it's a bit less complex than what you are proposing.
>>>>>>
>>>>>> On Wed, Jan 7, 2026 at 1:09?PM Bakul Shah via 9fans <9fans@9fans.net>
>>>>>> wrote:
>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> On Jan 7, 2026, at 8:41?AM, ori@eigenstate.org wrote:
>>>>>>>>
>>>>>>>> Quoth Bakul Shah via 9fans <9fans@9fans.net>:
>>>>>>>>> I have this idea that will horrify most of you!
>>>>>>>>>
>>>>>>>>> 1. Create an mmap device driver. You ask it to a new file handle
>>>>>>> which you use to communicate about memory mapping.
>>>>>>>>> 2. If you want to mmap some file, you open it and write its file
>>>>>>> descriptor along with other parameters (file offset, base addr, size, mode,
>>>>>>> flags) to your mmap file handle.
>>>>>>>>> 3. The mmap driver sets up necessary page table entries but doesn't
>>>>>>> actually fetch any data before returning from the write.
>>>>>>>>> 4. It can asynchronously kick off io requests on your behalf and
>>>>>>> fixup page table entries as needed.
>>>>>>>>> 5. Page faults in the mmapped area are serviced by making appropriate
>>>>>>> read/write calls.
>>>>>>>>> 6. Flags can be used to indicate read-ahead or write-behind for
>>>>>>> typical serial access.
>>>>>>>>> 7. Similarly msync, munmap etc. can be implemented.
>>>>>>>>>
>>>>>>>>> In a sneaky way this avoids the need for adding any mmap specific
>>>>>>> syscalls! But the underlying work would be mostly similar in either case.
>>>>>>>>>
>>>>>>>>> The main benefits of mmap are reduced initial latency , "pay as you
>>>>>>> go" cost structure and ease of use. It is certainly more expensive than
>>>>>>> reading/writing the same amount of data directly from a program.
>>>>>>>>>
>>>>>>>>> No idea how horrible a hack is needed to implement such a thing or
>>>>>>> even if it is possible at all but I had to share this ;-)
>>>>>>>>
>>>>>>>> To what end? The problems with mmap have little to do with adding a
>>>>>>> syscall;
>>>>>>>> they're about how you do things like communicating I/O errors.
>>>>>>> Especially
>>>>>>>> when flushing the cache.
>>>>>>>>
>>>>>>>> Imagine the following setup -- I've imported 9p.io:
>>>>>>>>
>>>>>>>> 9fs 9pio
>>>>>>>>
>>>>>>>> and then I map a file from it:
>>>>>>>>
>>>>>>>> mapped = mmap("/n/9pio/plan9/lib/words", OWRITE);
>>>>>>>>
>>>>>>>> Now, I want to write something into the file:
>>>>>>>>
>>>>>>>> *mapped = 1234;
>>>>>>>>
>>>>>>>> The cached version of the page is dirty, so the OS will
>>>>>>>> eventually need to flush it back with a 9p Twrite; Let's
>>>>>>>> assume that before this happens, the network goes down.
>>>>>>>>
>>>>>>>> How do you communicate the error with userspace?
>>>>>>>
>>>>>>> This was just a brainwave but...
>>>>>>>
>>>>>>> You have a (control) connection with the mmap device to
>>>>>>> set up mmap so might as well use it to convey errors!
>>>>>>> This device would be strictly local to where a program
>>>>>>> runs.
>>>>>>>
>>>>>>> I'd even consider allowing a separate process to mmap,
>>>>>>> by making an address space a first class object. That'd
>>>>>>> move more stuff out of the kernel and allow for more
>>>>>>> interesting/esoteric uses.
>>>>>> *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-Mf3cfeeb18fd00292d3f9063f>
>>>>>
>
> --
> Thierry Laronde <tlaronde +AT+ kergis +dot+ com>
> http://www.kergis.com/
> http://kertex.kergis.com/
> Key fingerprint = 0FF7 E906 FBAF FE95 FD89 250D 52B1 AE95 6006 F40C
------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/Te8d7c6e48b5c075b-Mae35de7f0d27935dac0dd51b
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription
next prev parent reply other threads:[~2026-01-09 20:07 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 [this message]
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
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=A70800B2-5651-4B2F-A475-D6F3F214EBBB@icloud.com \
--to=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).