]) # LIBCFS_RHASHTABLE_INSERT_FAST
#
+# LIBCFS_HAVE_NR_ZONE_WRITE_PENDING
+#
+# kernel v4.7-5966-g5a1c84b404a7
+# mm: remove reclaim and compaction retry approximations
+#
+AC_DEFUN([LIBCFS_SRC_HAVE_NR_ZONE_WRITE_PENDING], [
+ LB2_LINUX_TEST_SRC([nr_zone_write_pending_exists], [
+ #include <linux/mmzone.h>
+ ],[
+ enum zone_stat_item item = NR_ZONE_WRITE_PENDING;
+ (void)item;
+ ],[-Werror])
+])
+AC_DEFUN([LIBCFS_HAVE_NR_ZONE_WRITE_PENDING], [
+ AC_MSG_CHECKING([if NR_ZONE_WRITE_PENDING is available])
+ LB2_LINUX_TEST_RESULT([nr_zone_write_pending_exists], [
+ AC_DEFINE(HAVE_NR_ZONE_WRITE_PENDING, 1,
+ [NR_ZONE_WRITE_PENDING is still in use.])
+ ])
+]) # LIBCFS_HAVE_NR_ZONE_WRITE_PENDING
+
+#
# Kernel version 4.7-rc1 commit 8f6fd83c6c5ec66a4a70c728535ddcdfef4f3697
# added 3rd arg to rhashtable_walk_init
#
LIBCFS_SRC_RHASHTABLE_INSERT_FAST
LIBCFS_SRC_RHASHTABLE_WALK_INIT_3ARG
# 4.8
+ LIBCFS_SRC_HAVE_NR_ZONE_WRITE_PENDING
LIBCFS_SRC_RHASHTABLE_LOOKUP
LIBCFS_SRC_RHLTABLE
LIBCFS_SRC_STACKTRACE_OPS
LIBCFS_RHASHTABLE_INSERT_FAST
LIBCFS_RHASHTABLE_WALK_INIT_3ARG
# 4.8
+ LIBCFS_HAVE_NR_ZONE_WRITE_PENDING
LIBCFS_RHASHTABLE_LOOKUP
LIBCFS_RHLTABLE
LIBCFS_STACKTRACE_OPS
* newer kernels treat them like any other writeback.
* (see Linux commit: v5.7-467-g8d92890bd6b8)
*/
-#define NR_WRITEBACK NR_UNSTABLE_NFS
+#define NR_ZONE_WRITE_PENDING ((enum zone_stat_item)NR_UNSTABLE_NFS)
+#elif !defined(HAVE_NR_ZONE_WRITE_PENDING)
+#define NR_ZONE_WRITE_PENDING ((enum zone_stat_item)NR_WRITEBACK)
#endif
static inline void unstable_page_accounting(struct ptlrpc_bulk_desc *desc,
}
if (count > 0) {
- mod_zone_page_state(zone,
- (enum zone_stat_item)NR_WRITEBACK,
+ mod_zone_page_state(zone, NR_ZONE_WRITE_PENDING,
factor * count);
count = 0;
}
++count;
}
if (count > 0)
- mod_zone_page_state(zone, (enum zone_stat_item)NR_WRITEBACK,
+ mod_zone_page_state(zone, NR_ZONE_WRITE_PENDING,
factor * count);
EXIT;