[ofa-general] Re: [PATCH RFC] sharing userspace IB objects
Roland Dreier
rdreier at cisco.com
Mon Jun 25 13:51:50 PDT 2007
Some initial reaction, in no particular order:
- Having to allocate everything in memory that the library mmap()s
adds a lot of yucky stuff -- basically we need to implement our own
allocator for the shared memory offets. I guess we could wrap this
in libibverbs and only implement it once but still we're basically
reimplementing malloc().
Is there really a strong use case for making every type of object
shareable? Can we handle the SRC stuff without going to this
extreme of complexity?
- Given that everything shared is in shared memory, it seems we could
avoid all the marshalling/unmarshalling stuff, and just have the
shared objects have an ID along with an API to look up objects by
API. That way we could let applications use more than just unix
sockets -- eg pipe() + fork() would work too.
> +struct ibv_context *ibv_open_shared_device(struct ibv_device *device,
> + int fd, off_t offset);
- This seems like too low-level an interface; I don't think there's
any way to enforce the fact that fd came from shm_open(), and I
don't see the use of offset at all. I think it would be more
sensible to extend the normal ibv_open_device() with a pathname,
and maybe a flag about whether to create or map an existing shared
context, and do all the shm stuff internally. Then if someone
passes a NULL pathname, the context isn't shareable.
- R.
More information about the general
mailing list