summary refs log tree commit diff
diff options
context:
space:
mode:
authorPhilippe SWARTVAGHER <philippe.swartvagher@inria.fr>2022-04-11 15:00:54 +0200
committerLudovic Courtès <ludo@gnu.org>2022-04-11 15:49:32 +0200
commit37fa61364ea815a5d15f2a929860fa6fe2219fc8 (patch)
tree3ad4f61951f6f65e40a528ae2eef424f72c5f077
parent2c73e654fe1b39f8cec6082a068a435ca2b7cfd1 (diff)
downloadguix-37fa61364ea815a5d15f2a929860fa6fe2219fc8.tar.gz
gnu: hwloc@1: Update to 1.11.13.
* gnu/packages/patches/hwloc-1-test-btrfs.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/mpi.scm (hwloc-1): Use it and update to 1.11.13.

Co-authored-by: Ludovic Courtès <ludovic.courtes@inria.fr>
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/mpi.scm5
-rw-r--r--gnu/packages/patches/hwloc-1-test-btrfs.patch54
3 files changed, 58 insertions, 2 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index 5d0bee45d8..b4be32b9a2 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1273,6 +1273,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/hueplusplus-mbedtls.patch		\
   %D%/packages/patches/hurd-cross.patch				\
   %D%/packages/patches/hurd-xattr.patch				\
+  %D%/packages/patches/hwloc-1-test-btrfs.patch			\
   %D%/packages/patches/i7z-gcc-10.patch				\
   %D%/packages/patches/icecat-makeicecat.patch			\
   %D%/packages/patches/icecat-avoid-bundled-libraries.patch	\
diff --git a/gnu/packages/mpi.scm b/gnu/packages/mpi.scm
index 94c32684fb..946c55c4a5 100644
--- a/gnu/packages/mpi.scm
+++ b/gnu/packages/mpi.scm
@@ -57,7 +57,7 @@
   ;; to migrate to 2.0.
   (package
     (name "hwloc")
-    (version "1.11.12")
+    (version "1.11.13")
     (source (origin
               (method url-fetch)
               (uri (string-append "https://www.open-mpi.org/software/hwloc/v"
@@ -65,7 +65,8 @@
                                   "/downloads/hwloc-" version ".tar.bz2"))
               (sha256
                (base32
-                "0za1b9lvrm3rhn0lrxja5f64r0aq1qs4m0pxn1ji2mbi8ndppyyx"))))
+                "1j69p8a1pjpbpwn4w7l4dfxmaxxqikchjzqw1ncw05zmcmvlnjd4"))
+              (patches (search-patches "hwloc-1-test-btrfs.patch"))))
 
     (properties
      ;; Tell the 'generic-html' updater to monitor this URL for updates.
diff --git a/gnu/packages/patches/hwloc-1-test-btrfs.patch b/gnu/packages/patches/hwloc-1-test-btrfs.patch
new file mode 100644
index 0000000000..a5d3780e2d
--- /dev/null
+++ b/gnu/packages/patches/hwloc-1-test-btrfs.patch
@@ -0,0 +1,54 @@
+From 093316a897a2eb4972a7a3a5888f40975d03f6bf Mon Sep 17 00:00:00 2001
+From: Brice Goglin <Brice.Goglin@inria.fr>
+Date: Tue, 5 Apr 2022 17:39:50 +0200
+Subject: [PATCH] linux: (partial) fix the discovery of hugepages on btrfs
+ fsroot
+
+btrfs always returns 1 in directory stat.st_nlink.
+It breaks make check in tests/linux/ because the hugepages discovery
+uses st_nlink to allocate the memory page_types array.
+
+Always allocate at least 3 page_types slots
+(enough for all known cases, 1 for normal, 2 for huge pages)
+
+(partially cherry-picked from commit 7f351cec9bfe54a031f35ad16c9cfb99784d76dc)
+
+We don't reallocate later if needed as in 2.x commit 7f351cec9bfe54a031f35ad16c9cfb99784d76dc
+because v1.11 doesn't deserve a complete fix. Just commit the minimal change
+so that tests/linux/2i386-2t-hugepagesizecount with HWLOC_PAGESIZE_DEBUG=4096
+doesn't crash in btrfs anymore (test-topology.sh fails during make check if /tmp is in btrfs).
+
+Thanks to Philippe Swartvagher for the report.
+
+Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
+---
+ src/topology-linux.c | 11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/src/topology-linux.c b/src/topology-linux.c
+index 58c275fea..269eca7f5 100644
+--- a/src/topology-linux.c
++++ b/src/topology-linux.c
+@@ -1,6 +1,6 @@
+ /*
+  * Copyright © 2009 CNRS
+- * Copyright © 2009-2019 Inria.  All rights reserved.
++ * Copyright © 2009-2022 Inria.  All rights reserved.
+  * Copyright © 2009-2013, 2015 Université Bordeaux
+  * Copyright © 2009-2014 Cisco Systems, Inc.  All rights reserved.
+  * Copyright © 2015 Intel, Inc.  All rights reserved.
+@@ -2329,7 +2329,14 @@ hwloc_get_procfs_meminfo_info(struct hwloc_topology *topology,
+ 
+   err = hwloc_stat("/sys/kernel/mm/hugepages", &st, data->root_fd);
+   if (!err) {
+-    types = 1 + st.st_nlink-2;
++    types = 1 /* normal non-huge size */ + st.st_nlink - 2 /* ignore . and .. */;
++    if (types < 3)
++      /* some buggy filesystems (e.g. btrfs when reading from fsroot)
++       * return wrong st_nlink for directories (always 1 for btrfs).
++       * use 3 as a sane default (default page + 2 huge sizes).
++       * hwloc_parse_hugepages_info() will extend it if needed.
++       */
++      types = 3;
+     has_sysfs_hugepages = 1;
+   }