Deleted Added
full compact
swap_pager.c (92029) swap_pager.c (92654)
1/*
2 * Copyright (c) 1998 Matthew Dillon,
3 * Copyright (c) 1994 John S. Dyson
4 * Copyright (c) 1990 University of Utah.
5 * Copyright (c) 1991, 1993
6 * The Regents of the University of California. All rights reserved.
7 *
8 * This code is derived from software contributed to Berkeley by

--- 50 unchanged lines hidden (view full) ---

59 * cycled (in a high-load system) by the pager. We also do on-the-fly
60 * removal of invalidated swap blocks when a page is destroyed
61 * or renamed.
62 *
63 * from: Utah $Hdr: swap_pager.c 1.4 91/04/30$
64 *
65 * @(#)swap_pager.c 8.9 (Berkeley) 3/21/94
66 *
1/*
2 * Copyright (c) 1998 Matthew Dillon,
3 * Copyright (c) 1994 John S. Dyson
4 * Copyright (c) 1990 University of Utah.
5 * Copyright (c) 1991, 1993
6 * The Regents of the University of California. All rights reserved.
7 *
8 * This code is derived from software contributed to Berkeley by

--- 50 unchanged lines hidden (view full) ---

59 * cycled (in a high-load system) by the pager. We also do on-the-fly
60 * removal of invalidated swap blocks when a page is destroyed
61 * or renamed.
62 *
63 * from: Utah $Hdr: swap_pager.c 1.4 91/04/30$
64 *
65 * @(#)swap_pager.c 8.9 (Berkeley) 3/21/94
66 *
67 * $FreeBSD: head/sys/vm/swap_pager.c 92029 2002-03-10 21:52:48Z eivind $
67 * $FreeBSD: head/sys/vm/swap_pager.c 92654 2002-03-19 09:11:49Z jeff $
68 */
69
70#include <sys/param.h>
71#include <sys/systm.h>
72#include <sys/conf.h>
73#include <sys/kernel.h>
74#include <sys/proc.h>
75#include <sys/bio.h>

--- 239 unchanged lines hidden (view full) ---

315 * we need based on the number of pages in the system. Each swblock
316 * can hold 16 pages, so this is probably overkill. This reservation
317 * is typically limited to around 70MB by default.
318 */
319 n = cnt.v_page_count;
320 if (maxswzone && n > maxswzone / sizeof(struct swblock))
321 n = maxswzone / sizeof(struct swblock);
322 n2 = n;
68 */
69
70#include <sys/param.h>
71#include <sys/systm.h>
72#include <sys/conf.h>
73#include <sys/kernel.h>
74#include <sys/proc.h>
75#include <sys/bio.h>

--- 239 unchanged lines hidden (view full) ---

315 * we need based on the number of pages in the system. Each swblock
316 * can hold 16 pages, so this is probably overkill. This reservation
317 * is typically limited to around 70MB by default.
318 */
319 n = cnt.v_page_count;
320 if (maxswzone && n > maxswzone / sizeof(struct swblock))
321 n = maxswzone / sizeof(struct swblock);
322 n2 = n;
323 swap_zone = zinit(
324 "SWAPMETA",
325 sizeof(struct swblock),
326 n,
327 ZONE_INTERRUPT,
328 1
329 );
323 do {
330 do {
324 swap_zone = zinit(
325 "SWAPMETA",
326 sizeof(struct swblock),
327 n,
328 ZONE_INTERRUPT,
329 1
330 );
331 if (swap_zone != NULL)
331 if (uma_zone_set_obj(swap_zone, NULL, n))
332 break;
333 /*
334 * if the allocation failed, try a zone two thirds the
335 * size of the previous attempt.
336 */
337 n -= ((n + 2) / 3);
338 } while (n > 0);
339 if (swap_zone == NULL)

--- 1703 unchanged lines hidden ---
332 break;
333 /*
334 * if the allocation failed, try a zone two thirds the
335 * size of the previous attempt.
336 */
337 n -= ((n + 2) / 3);
338 } while (n > 0);
339 if (swap_zone == NULL)

--- 1703 unchanged lines hidden ---