[Barrelfish-users] cross-domain shared memory

Simon Gerber simugerber at student.ethz.ch
Thu Apr 5 16:53:32 CEST 2012


What you can do right now is to send a Frame capability to another domain
which then maps that memory into its address space (see
lib/barrelfish/bulk_transfer.c and usr/bench/bulk_bench/bulkbench.c for an
example of shared memory in Barrelfish). However, due to the way Barrelfish
allocates virtual addresses when mapping Frame capabilities there are no
guarantees that the virtual addresses of a memory region will match in all
domains that share that region, and thus you'll need to work with offsets into
the shared region for now.

Also, I'm doing a redesign of the Barrelfish virtual memory subsystem as my
Master's thesis. For now, I've been focused on ensuring that the promises made
by that capability system are kept in the presence of shared memory regions,
e.g. if you revoke a Frame capability that is shared between domains, the
memory that is identified by that Frame capability is unmapped in all other
domains, thus always ensuring that only domains that have a copy of the
capability have access to the physical memory.

However, I haven't implemented much of the higher-level functionality that
would be needed for "shared pointers" -- the crucial part that is missing is
that there is no way for user programs to specify an arbitrary virtual address
when installing a new mapping using the vspace/vregion API, which you should
use if you don't want other code that uses it (malloc) to fail unexpectedly
when it stumbles across the mappings you inserted by directly calling into the
kernel (using vnode_map()). In fact what I'm doing to test the new
functionality I've introduced is mostly what I've described above.

Hope this helps a bit,

-- Simon

2012/4/5 Georgios Varisteas <yorgos at kth.se>:
> Hi,
> In BF, each domain has its own virtual memory address space which makes sense as a method of isolation and protection. Thus sending a pointer across domains is useless. However, if I would like to actually share memory across domains (with all implications considered), is there any way to accomplish it (eventually) as simply as messaging a pointer is? I'm not very optimistic since such functionality is vertical to the fundamental principles of BF. If I would like to add it though, could you give me some pointers? I must admit that the whole capability system still confuses me.
> Best regards,
> Georgios Varisteas
> _______________________________________________
> Barrelfish-users mailing list
> Barrelfish-users at lists.inf.ethz.ch
> https://lists.inf.ethz.ch/mailman/listinfo/barrelfish-users

More information about the Barrelfish-users mailing list