[Darshan-commits] [Git][darshan/darshan][master] 2 commits: skip instrumentation attempts on anonymous mmap()

Shane Snyder xgitlab at cels.anl.gov
Thu Jan 19 10:34:13 CST 2017


Shane Snyder pushed to branch master at darshan / darshan


Commits:
969b6285 by Phil Carns at 2017-01-19T08:16:46-08:00
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.

- - - - -
165118c5 by Shane Snyder at 2017-01-19T10:34:10-06:00
Merge branch 'issue-210-cray-hugepages' into 'master'

skip instrumentation attempts on anonymous mmap()

Closes #210

See merge request !5
- - - - -


2 changed files:

- ChangeLog
- darshan-runtime/lib/darshan-posix.c


Changes:

=====================================
ChangeLog
=====================================
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,9 @@ Darshan-3.1.3-pre1
 * add --enable-HDF5_1.10 configure option to explicitly enable HDF5 1.10+
   support, needed on some platforms for API compatibility 
   - contributed by Karl-Ulrich Bamberg
+* 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.1.2
 =============


=====================================
darshan-runtime/lib/darshan-posix.c
=====================================
--- a/darshan-runtime/lib/darshan-posix.c
+++ b/darshan-runtime/lib/darshan-posix.c
@@ -925,6 +925,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);
@@ -948,6 +956,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);



View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/compare/78ac2f2941f971ae63a7fc61ae98ddf3a058da70...165118c5517095ee0060bc25da355f695489cf3f
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/darshan-commits/attachments/20170119/c80327c1/attachment-0001.html>


More information about the Darshan-commits mailing list