AC_MSG_RESULT(no)
])
])
+
+dnl #
+dnl # 3.12 API change
+dnl # The nid member was added to struct shrink_control to support
+dnl # NUMA-aware shrinkers.
+dnl #
+AC_DEFUN([ZFS_AC_KERNEL_SHRINK_CONTROL_HAS_NID], [
+ AC_MSG_CHECKING([whether shrink_control has nid])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+ ],[
+ struct shrink_control sc __attribute__ ((unused));
+ unsigned long scnidsize __attribute__ ((unused)) =
+ sizeof(sc.nid);
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(SHRINK_CONTROL_HAS_NID, 1,
+ [struct shrink_control has nid])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+])
ZFS_AC_KERNEL_CALLBACK_SECURITY_INODE_INIT_SECURITY
ZFS_AC_KERNEL_MOUNT_NODEV
ZFS_AC_KERNEL_SHRINK
+ ZFS_AC_KERNEL_SHRINK_CONTROL_HAS_NID
ZFS_AC_KERNEL_S_INSTANCES_LIST_HEAD
ZFS_AC_KERNEL_S_D_OP
ZFS_AC_KERNEL_BDI_SETUP_AND_REGISTER
#include <sys/zpl.h>
#include "zfs_comutil.h"
-
/*ARGSUSED*/
int
zfs_sync(struct super_block *sb, int wait, cred_t *cr)
ZFS_ENTER(zsb);
-#if defined(HAVE_SPLIT_SHRINKER_CALLBACK)
+#if defined(HAVE_SPLIT_SHRINKER_CALLBACK) && \
+ defined(SHRINK_CONTROL_HAS_NID) && \
+ defined(SHRINKER_NUMA_AWARE)
+ if (sb->s_shrink.flags & SHRINKER_NUMA_AWARE) {
+ *objects = 0;
+ for_each_online_node(sc.nid)
+ *objects += (*shrinker->scan_objects)(shrinker, &sc);
+ } else {
+ *objects = (*shrinker->scan_objects)(shrinker, &sc);
+ }
+#elif defined(HAVE_SPLIT_SHRINKER_CALLBACK)
*objects = (*shrinker->scan_objects)(shrinker, &sc);
#elif defined(HAVE_SHRINK)
*objects = (*shrinker->shrink)(shrinker, &sc);