diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -2669,21 +2669,23 @@ } /* - * Check that the total amount of swap currently configured does not - * exceed half the theoretical maximum. If it does, print a warning - * message. + * Check that the total amount of swap does not exceed the maximum or + * recommended values, and print a warning if it does. The recommended + * value is half the maximum value, to account for fragmentation. */ static void swapon_check_swzone(void) { - - /* recommend using no more than half that amount */ - if (swap_total > swap_maxpages / 2) { + if (swap_total > swap_maxpages) { + printf("warning: total configured swap (%lu pages) " + "exceeds maximum supported amount (%lu pages).\n" + "warning: increase kern.maxswzone " + "or reduce amount of swap.\n", + swap_total, swap_maxpages); + } else if (swap_total > swap_maxpages / 2) { printf("warning: total configured swap (%lu pages) " - "exceeds maximum recommended amount (%lu pages).\n", + "exceeds recommended amount (%lu pages).\n", swap_total, swap_maxpages / 2); - printf("warning: increase kern.maxswzone " - "or reduce amount of swap.\n"); } }