From 2209e40981e887c773914ec0f3b73cedf45ddb7d Mon Sep 17 00:00:00 2001 From: dbavatar Date: Thu, 24 Aug 2017 13:48:23 -0400 Subject: Linux 4.8+ compatibility fix for vm stats vm_node_stat must be used instead of vm_zone_stat. Unfortunately the old code still compiles potentially leading to silent failure of arc_evictable_memory() AKAMAI: CR 3816601: Regression in zfs dropcache test Reviewed-by: Brian Behlendorf Reviewed-by: Chunwei Chen Signed-off-by: Debabrata Banerjee Closes #6528 --- config/kernel-vm_node_stat.m4 | 22 ++++++++++++++++++++++ config/kernel.m4 | 1 + 2 files changed, 23 insertions(+) create mode 100644 config/kernel-vm_node_stat.m4 (limited to 'config') diff --git a/config/kernel-vm_node_stat.m4 b/config/kernel-vm_node_stat.m4 new file mode 100644 index 000000000..e1c42f884 --- /dev/null +++ b/config/kernel-vm_node_stat.m4 @@ -0,0 +1,22 @@ +dnl # +dnl # 4.8 API change +dnl # kernel vm counters change +dnl # +AC_DEFUN([ZFS_AC_KERNEL_VM_NODE_STAT], [ + AC_MSG_CHECKING([whether to use vm_node_stat based fn's]) + ZFS_LINUX_TRY_COMPILE([ + #include + #include + ],[ + int a __attribute__ ((unused)) = NR_VM_NODE_STAT_ITEMS; + long x __attribute__ ((unused)) = + atomic_long_read(&vm_node_stat[0]); + (void) global_node_page_state(0); + ],[ + AC_MSG_RESULT(yes) + AC_DEFINE(ZFS_GLOBAL_NODE_PAGE_STATE, 1, + [using global_node_page_state()]) + ],[ + AC_MSG_RESULT(no) + ]) +]) diff --git a/config/kernel.m4 b/config/kernel.m4 index e92a65987..3739f85fb 100644 --- a/config/kernel.m4 +++ b/config/kernel.m4 @@ -120,6 +120,7 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [ ZFS_AC_KERNEL_RENAME_WANTS_FLAGS ZFS_AC_KERNEL_HAVE_GENERIC_SETXATTR ZFS_AC_KERNEL_CURRENT_TIME + ZFS_AC_KERNEL_VM_NODE_STAT AS_IF([test "$LINUX_OBJ" != "$LINUX"], [ KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ" -- cgit v1.2.3