Commit 7bad56a3 authored by Philip Carns's avatar Philip Carns

skip instrumentation attempts on anonymous mmap()

Anonymous mmap() calls have no backing file and therefore won't match
any Darshan characterization records, so we can skip the record lookup
in this case.  This also fixes a deadlock on Cray systems with hugepages
enabled, see #210.
parent 08855b48
......@@ -2,6 +2,12 @@
Darshan Release Change Log
--------------------------
Darshan-3.0.1.1
=============
* skip instrumentation attempts for anonymous mmap() calls; this avoids a
potentential deadlock condition when used with hugepages on Cray systems.
Reported by Glenn Lockwood and Cristian Simarro.
Darshan-3.0.1
=============
* bug fix in darshan logutil mount parsing code that was
......
......@@ -1085,6 +1085,14 @@ void* DARSHAN_DECL(mmap)(void *addr, size_t length, int prot, int flags,
MAP_OR_FAIL(mmap);
if(fd < 0 || (flags & MAP_ANONYMOUS))
{
/* mmap is not associated with a backing file; skip all Darshan
* characterization attempts.
*/
return(__real_mmap(addr, length, prot, flags, fd, offset));
}
ret = __real_mmap(addr, length, prot, flags, fd, offset);
if(ret == MAP_FAILED)
return(ret);
......@@ -1109,6 +1117,14 @@ void* DARSHAN_DECL(mmap64)(void *addr, size_t length, int prot, int flags,
MAP_OR_FAIL(mmap64);
if(fd < 0 || (flags & MAP_ANONYMOUS))
{
/* mmap is not associated with a backing file; skip all Darshan
* characterization attempts.
*/
return(__real_mmap64(addr, length, prot, flags, fd, offset));
}
ret = __real_mmap64(addr, length, prot, flags, fd, offset);
if(ret == MAP_FAILED)
return(ret);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment