diff options
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/swap_pager.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index f2d6061..e25a556 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -323,10 +323,13 @@ swap_pager_swap_init() /* * Initialize our zone. Right now I'm just guessing on the number * we need based on the number of pages in the system. Each swblock - * can hold 16 pages, so this is probably overkill. + * can hold 16 pages, so this is probably overkill. This reservation + * is typically limited to around 70MB by default. */ - n = min(cnt.v_page_count, (kernel_map->max_offset - kernel_map->min_offset) / PAGE_SIZE) * 2; + n = cnt.v_page_count; + if (maxswzone && n > maxswzone / sizeof(struct swblock)) + n = maxswzone / sizeof(struct swblock); n2 = n; do { |