mcst-linux-kernel/patches-2024.06.26/zfs-2.1.5/0003-check-discontinuous-cp...

38 lines
1.2 KiB
Diff

Link:
Subject: check if kernel supports discontinuous cpu numeration
Bug: 107537
Tags: e2k
diff -rupN a/config/kernel.m4 b/config/kernel.m4
--- a/config/kernel.m4 2023-03-29 03:55:11.432430717 +0300
+++ b/config/kernel.m4 2023-03-29 18:14:39.420346376 +0300
@@ -7,6 +7,8 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [
ZFS_AC_KERNEL
ZFS_AC_QAT
+ CHECK_DISCONTINUOUS_CPU_NUMERATION
+
dnl # Sanity checks for module building and CONFIG_* defines
ZFS_AC_KERNEL_CONFIG_DEFINED
ZFS_AC_MODULE_SYMVERS
@@ -939,3 +941,19 @@ AC_DEFUN([ZFS_LINUX_TRY_COMPILE_HEADER],
[test -f build/conftest/conftest.ko],
[$3], [$4], [$5])
])
+
+AC_DEFUN([CHECK_DISCONTINUOUS_CPU_NUMERATION], [
+ AS_CASE([$host_cpu],
+ [e2k*],
+ [AC_MSG_CHECKING([if kernel supports discontinuous cpu numeration])
+ linux_major="${LINUX_VERSION%%.*}"
+ AS_IF([test $linux_major -lt 5], [
+ AC_MSG_RESULT(no)
+ AC_MSG_ERROR([
+ *** ZFS requires discontinuous cpu numeration patch for NUMA (bug 107537).
+ ])
+ ], [
+ AC_MSG_RESULT(yes)
+ ])
+ ])
+])