]> git.openfabrics.org - ~shefty/librdmacm.git/commitdiff
rspreload: Avoid rsocket calls until after fork
authorSean Hefty <sean.hefty@intel.com>
Thu, 23 Aug 2012 18:20:08 +0000 (11:20 -0700)
committerSean Hefty <sean.hefty@intel.com>
Thu, 23 Aug 2012 18:20:08 +0000 (11:20 -0700)
When an rsocket call is made before an application calls fork(),
the forked applications can hang.  This can be seen by running
netserver and two netperf clients simultaneously.  The second
netperf client will eventually stop performing data transfers.

LD_PRELOAD=librspreload.so netserver -D

LD_PRELOAD=librspreload.so netperf -v2 -c -C -H 192.168.0.101 -l30
LD_PRELOAD=librspreload.so netperf -v2 -c -C -H 192.168.0.101 -l30

It's not clear what the specific problem is.  The best guess is
that libibverbs or the provider library (e.g. libmlx4) perform
some initialization, such as mmap'ing device memory, which does not
work when fork is called.

As a work-around, avoid calling rsocket routines until immediately
before they are needed.  This allows the process to fork before
the libraries are initialized.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>

No differences found