diff --git a/include/sys/vmsystm.h b/include/sys/vmsystm.h index 34aea2b98f..909749103b 100644 --- a/include/sys/vmsystm.h +++ b/include/sys/vmsystm.h @@ -41,7 +41,7 @@ */ #define membar_producer() smp_wmb() -#define physmem num_physpages +#define physmem totalram_pages #define freemem nr_free_pages() #define availrmem spl_kmem_availrmem() diff --git a/module/spl/spl-debug.c b/module/spl/spl-debug.c index 37599acdd3..d450368b10 100644 --- a/module/spl/spl-debug.c +++ b/module/spl/spl-debug.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -548,7 +549,7 @@ trace_print_to_console(struct spl_debug_header *hdr, int mask, const char *buf, static int trace_max_debug_mb(void) { - return MAX(512, ((num_physpages >> (20 - PAGE_SHIFT)) * 80) / 100); + return MAX(512, ((totalram_pages >> (20 - PAGE_SHIFT)) * 80) / 100); } static struct trace_page * @@ -1188,7 +1189,7 @@ spl_debug_init(void) /* If spl_debug_mb is set to an invalid value or uninitialized * then just make the total buffers smp_num_cpus TCD_MAX_PAGES */ - if (max > (num_physpages >> (20 - 2 - PAGE_SHIFT)) / 5 || + if (max > (totalram_pages >> (20 - 2 - PAGE_SHIFT)) / 5 || max >= 512 || max < 0) { max = TCD_MAX_PAGES; } else {