Page 1 of 1

Jumbo Messages in microkernels

Posted: Wed Apr 13, 2005 5:10 am
by Pype.Clicker
A few weeks ago, i was sharing the 'ports' addition of clicker. Among key concepts, 'messages' were small and of fixed size (4 dwords) and threads could act as 'container' for messages that are yet to be sent or that are yet to be received.

Now, i'm just starting to add support for zero-copy "jumbo messages" (which can grow up to 4MB). The key idea is to have (at the receiver) a memory structure that can temporarily map received jumbos while they're processed. In the case of a Jumbo Message, clicker will transmit the frame number for the holding page table plus a "exported address" which is made of:

- how many pages are exported (10 bits)
- what's the index of the first exported page in the table (10 bits)
- what's the offset of the exported data in that first page (12 bits)

Table Frame number is part of the 'message code' and we expect that one jumbo only use one table (which means you can have as many 'exported address' as you want in the message.

The receiver uses a hash-table-driven cache of page tables and another hash-table for pages, which means it can avoid re-mapping a page that has already been mapped (hum. it should. this is still under progress ...)

Re:Jumbo Messages in microkernels

Posted: Wed Apr 13, 2005 5:37 am
by DruG5t0r3
I see some docs on your side is in french. You speak french?

Re:Jumbo Messages in microkernels

Posted: Wed Apr 13, 2005 6:05 am
by distantvoices
ah - copyless message passing - that would speed up quite some things :-)

passing around a shared memory entity which the receiver can map in is no option, is it? well - the overhead of shared mem management would kill the speed benefit *hmmmmm* gonna see.

I gonna check back have to look at this at home. Work to do.

Re:Jumbo Messages in microkernels

Posted: Wed Apr 13, 2005 7:24 am
by Pype.Clicker
beyond infinity wrote: passing around a shared memory entity which the receiver can map in is no option, is it?
Actually that's more or less what's happening, except i don't require the _whole_ entity to be shared, only what's needed.

The situation is that you will have several process (usually servers) contributing to the Kernel Dynamic Storage. The video server could (for instance) keep a list of all available video modes while the network server keeps the ARP cache. I'd like an application (that has enough credentials) to be able to access those informations, but without having to map the _whole_ exported information at the application (only what's requested). Moreover, the application has control over how much virtual memory it dedicates to mapping jumbo messages.


And indeed, i'm natively french-speaking belgian dude (i mean, before i got relocated in a galaxy, far, far away).

Re:Jumbo Messages in microkernels

Posted: Wed Apr 13, 2005 7:39 am
by DruG5t0r3
And indeed, i'm natively french-speaking belgian dude (i mean, before i got relocated in a galaxy, far, far away).
I'm a nativaly french-speaking person too, though from the other side of the world :P

Re:Jumbo Messages in microkernels

Posted: Wed Apr 13, 2005 7:44 am
by distantvoices
quebec, eh?

Ici en autriche il fait beaucoup de nuages. Comme est-il, le temps en Quebec?

Re:Jumbo Messages in microkernels

Posted: Wed Apr 13, 2005 7:48 am
by DruG5t0r3
beaucoup de nuages :P

environ 5-6 degres C

Re:Jumbo Messages in microkernels

Posted: Wed Apr 13, 2005 7:54 am
by Solar
Excuse me if I'm dense, but that does imply that a Jumbo Message must not include absolute pointers, as it cannot be guaranteed that the receiver maps the page(s) at the same virtual address than the sender - right?

Re:Jumbo Messages in microkernels

Posted: Wed Apr 13, 2005 8:47 am
by Pype.Clicker
indeed. Jumbo messages are meant to ease the transmission of large text, lists (if serialized properly) and things alike. But they remain _messages_ which means they cannot contain flat pointers.

@BI: you should have said "il y a beaucoup de nuages" (very cloudy) and "Quel temps fait-il au Quebec" (How's the weather like, in Quebec) B)

Re:Jumbo Messages in microkernels

Posted: Thu Apr 14, 2005 1:51 am
by Pype.Clicker
Solar wrote: Excuse me if I'm dense, but that does imply that a Jumbo Message must not include absolute pointers, as it cannot be guaranteed that the receiver maps the page(s) at the same virtual address than the sender - right?
actually, i had a solution to pass arbitrary structures, provided that they come from a single "exporting" area:

1. the client side traverses the structure, identifying all the pointers (okay, that means you have to know the actual structure. This is the job of some auto-generated code of some sort based on the structure itself).

2. from that traversal, one builds a "relocation list" that indicates the 'exportable address' of every component in the structure and the list of pointers manipulation that is required for that component.

3. the kernel simply passes the 'relocation list' as a jumbo message.

Then i'm not yet decided of whether i'll have the structure re-created locally or use accessors to lazily import data and re-locate pointers on the fly. That probably depends on what you want to do with the imported structure.

Re:Jumbo Messages in microkernels

Posted: Thu Apr 14, 2005 2:52 am
by Candy
somehow the title makes me amazed... probably due to a little headache

you have very very large messages in a kernel designed to be very small and fast?

Re:Jumbo Messages in microkernels

Posted: Thu Apr 14, 2005 3:16 am
by distantvoices
@pype: Merci pour la correction. 8) Il me faut d'exercicer le francais plus.

@candy: you are sure you don't want a Aspirin?

Re:Jumbo Messages in microkernels

Posted: Thu Apr 14, 2005 5:54 am
by Pype.Clicker
Candy wrote: you have very very large messages in a kernel designed to be very small and fast?
Well, should the fact the kernel is small and fast imply that process running on top of that kernel cannot swap large amount of data ? Be it simply file names or URLs, those are usually too large for going through the 'usual' 4 or 8 dwords messages ...

Re:Jumbo Messages in microkernels

Posted: Thu Apr 14, 2005 6:38 am
by Solar
Depending on how you use your messaging system, you could end up with messages containing GUI bitmaps, audio samples, or 3D textures...