index 2b48fe0e369..6bdfc852ac0 100644
--- a/include/spl/sys/vmsystm.h
+++ b/include/spl/sys/vmsystm.h
-@@ -33,8 +33,14 @@
+@@ -33,8 +33,16 @@
#include <sys/types.h>
#include <asm/uaccess.h>
+#ifdef HAVE_TOTALRAM_PAGES_FUNC
+#define zfs_totalram_pages totalram_pages()
++#define zfs_totalhigh_pages totalhigh_pages()
+#else
+#define zfs_totalram_pages totalram_pages
++#define zfs_totalhigh_pages totalhigh_pages
+#endif
+
#define membar_producer() smp_wmb()
#ifdef _KERNEL
#ifdef CONFIG_HIGHMEM
- return (ptob(totalram_pages - totalhigh_pages));
-+ return (ptob(zfs_totalram_pages - totalhigh_pages));
++ return (ptob(zfs_totalram_pages - zfs_totalhigh_pages));
#else
- return (ptob(totalram_pages));
+ return (ptob(zfs_totalram_pages));