how to do large-ish IPC transfers

Vernon Mauery vernon.mauery at linux.intel.com
Thu Sep 12 04:31:02 AEST 2019


On 11-Sep-2019 01:49 PM, Brad Bishop wrote:
> Hi everyone
> 
> I have an application or two that need to collect and save ~ 16KiB of
> debugging data.  The applications have various triggers but they are very
> infrequent when deployed (on the order of months/years).  In the lab it
> would happen much more frequently.  It isn’t really debugging information
> for the developer of the application but rather for customer service
> personnel debugging broken components on a deployed server, after the event
> (and state) that caused the data to be collected.
> 
> The applications generating this data will not be the same applications that
> publish it (the webserver), so there is a need to transfer it using IPC.
> 
> 16KiB seemed a little big for a DBus interface, and we’d have to ascii
> encode all that into a string.  Some other ideas were:
> 
> 1 - passing a file descriptor over dbus

This would probably be the best, given our architecture. It would allow, 
at some point in the future, to have the sender have different 
permissions on the file and allow access to a less-privileged process.

> 2 - passing a file name over dbus
> 3 - shared memory

Two and three could be the same (if that file is in a tmpfs). System V 
shared memory is a pain to use, so simply mmap'ing a file in tmpfs is 
the easiest way to go. But both of these require permissions to align 
between sender and receiver.

--Vernon

> 
> Are there reasons to steer clear of any of these?  Security concerns?
> Performance concerns?  Maintainability concerns?
> 
> Are there other choices I’m not thinking of?
> 
> thanks in advance!
> 
> -brad


More information about the openbmc mailing list