4 dnl # 75ef71840539 mm, vmstat: add infrastructure for per-node vmstats
5 dnl # 599d0c954f91 mm, vmscan: move LRU lists to node
7 AC_DEFUN([ZFS_AC_KERNEL_SRC_GLOBAL_NODE_PAGE_STATE], [
8 ZFS_LINUX_TEST_SRC([global_node_page_state], [
10 #include <linux/vmstat.h>
12 (void) global_node_page_state(0);
16 AC_DEFUN([ZFS_AC_KERNEL_GLOBAL_NODE_PAGE_STATE], [
17 AC_MSG_CHECKING([whether global_node_page_state() exists])
18 ZFS_LINUX_TEST_RESULT([global_node_page_state], [
20 AC_DEFINE(ZFS_GLOBAL_NODE_PAGE_STATE, 1,
21 [global_node_page_state() exists])
30 dnl # c41f012ade0b mm: rename global_page_state to global_zone_page_state
32 AC_DEFUN([ZFS_AC_KERNEL_SRC_GLOBAL_ZONE_PAGE_STATE], [
33 ZFS_LINUX_TEST_SRC([global_zone_page_state], [
35 #include <linux/vmstat.h>
37 (void) global_zone_page_state(0);
41 AC_DEFUN([ZFS_AC_KERNEL_GLOBAL_ZONE_PAGE_STATE], [
42 AC_MSG_CHECKING([whether global_zone_page_state() exists])
43 ZFS_LINUX_TEST_RESULT([global_zone_page_state], [
45 AC_DEFINE(ZFS_GLOBAL_ZONE_PAGE_STATE, 1,
46 [global_zone_page_state() exists])
53 dnl # Create a define and autoconf variable for an enum member
55 AC_DEFUN([ZFS_AC_KERNEL_ENUM_MEMBER], [
56 AC_MSG_CHECKING([whether enum $2 contains $1])
57 AS_IF([AC_TRY_COMMAND(
58 "${srcdir}/scripts/enum-extract.pl" "$2" "$3" | grep -Eqx $1)],[
60 AC_DEFINE(m4_join([_], [ZFS_ENUM], m4_toupper($2), $1), 1,
61 [enum $2 contains $1])
62 m4_join([_], [ZFS_ENUM], m4_toupper($2), $1)=1
69 dnl # Sanity check helpers
71 AC_DEFUN([ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_ERROR],[
73 AC_MSG_RESULT([$1 in either node_stat_item or zone_stat_item: $2])
74 ZFS_LINUX_TEST_ERROR([global page state])
77 AC_DEFUN([ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_CHECK], [
78 enum_check_a="m4_join([_], [$ZFS_ENUM_NODE_STAT_ITEM], $1)"
79 enum_check_b="m4_join([_], [$ZFS_ENUM_ZONE_STAT_ITEM], $1)"
80 AS_IF([test -n "$enum_check_a" -a -n "$enum_check_b"],[
81 ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_ERROR([$1], [DUPLICATE])
83 AS_IF([test -z "$enum_check_a" -a -z "$enum_check_b"],[
84 ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_ERROR([$1], [NOT FOUND])
89 dnl # Ensure the config tests are finding one and only one of each enum.
91 AC_DEFUN([ZFS_AC_KERNEL_GLOBAL_ZONE_PAGE_STATE_SANITY], [
92 AC_MSG_CHECKING([whether global_page_state enums are sane])
94 ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_CHECK([NR_FILE_PAGES])
95 ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_CHECK([NR_INACTIVE_ANON])
96 ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_CHECK([NR_INACTIVE_FILE])
101 AC_DEFUN([ZFS_AC_KERNEL_SRC_GLOBAL_PAGE_STATE], [
102 ZFS_AC_KERNEL_SRC_GLOBAL_NODE_PAGE_STATE
103 ZFS_AC_KERNEL_SRC_GLOBAL_ZONE_PAGE_STATE
107 dnl # enum members in which we're interested
109 AC_DEFUN([ZFS_AC_KERNEL_GLOBAL_PAGE_STATE], [
110 ZFS_AC_KERNEL_GLOBAL_NODE_PAGE_STATE
111 ZFS_AC_KERNEL_GLOBAL_ZONE_PAGE_STATE
113 ZFS_AC_KERNEL_ENUM_MEMBER([NR_FILE_PAGES],
114 [node_stat_item], [$LINUX/include/linux/mmzone.h])
115 ZFS_AC_KERNEL_ENUM_MEMBER([NR_INACTIVE_ANON],
116 [node_stat_item], [$LINUX/include/linux/mmzone.h])
117 ZFS_AC_KERNEL_ENUM_MEMBER([NR_INACTIVE_FILE],
118 [node_stat_item], [$LINUX/include/linux/mmzone.h])
120 ZFS_AC_KERNEL_ENUM_MEMBER([NR_FILE_PAGES],
121 [zone_stat_item], [$LINUX/include/linux/mmzone.h])
122 ZFS_AC_KERNEL_ENUM_MEMBER([NR_INACTIVE_ANON],
123 [zone_stat_item], [$LINUX/include/linux/mmzone.h])
124 ZFS_AC_KERNEL_ENUM_MEMBER([NR_INACTIVE_FILE],
125 [zone_stat_item], [$LINUX/include/linux/mmzone.h])
127 ZFS_AC_KERNEL_GLOBAL_ZONE_PAGE_STATE_SANITY