Deleted Added
full compact
vm_glue.c (153485) vm_glue.c (159054)
1/*-
2 * Copyright (c) 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * The Mach Operating System project at Carnegie-Mellon University.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

52 * Carnegie Mellon University
53 * Pittsburgh PA 15213-3890
54 *
55 * any improvements or extensions that they make and grant Carnegie the
56 * rights to redistribute these changes.
57 */
58
59#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * The Mach Operating System project at Carnegie-Mellon University.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

52 * Carnegie Mellon University
53 * Pittsburgh PA 15213-3890
54 *
55 * any improvements or extensions that they make and grant Carnegie the
56 * rights to redistribute these changes.
57 */
58
59#include <sys/cdefs.h>
60__FBSDID("$FreeBSD: head/sys/vm/vm_glue.c 153485 2005-12-16 18:34:14Z alc $");
60__FBSDID("$FreeBSD: head/sys/vm/vm_glue.c 159054 2006-05-29 21:28:56Z tegge $");
61
62#include "opt_vm.h"
63#include "opt_kstack_pages.h"
64#include "opt_kstack_max_pages.h"
65
66#include <sys/param.h>
67#include <sys/systm.h>
68#include <sys/limits.h>

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

847 * deadlock. Test this first as
848 * this may block.
849 *
850 * Lock the map until swapout
851 * finishes, or a thread of this
852 * process may attempt to alter
853 * the map.
854 */
61
62#include "opt_vm.h"
63#include "opt_kstack_pages.h"
64#include "opt_kstack_max_pages.h"
65
66#include <sys/param.h>
67#include <sys/systm.h>
68#include <sys/limits.h>

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

847 * deadlock. Test this first as
848 * this may block.
849 *
850 * Lock the map until swapout
851 * finishes, or a thread of this
852 * process may attempt to alter
853 * the map.
854 */
855 PROC_LOCK(p);
856 vm = p->p_vmspace;
857 KASSERT(vm != NULL,
858 ("swapout_procs: a process has no address space"));
859 atomic_add_int(&vm->vm_refcnt, 1);
860 PROC_UNLOCK(p);
855 vm = vmspace_acquire_ref(p);
856 if (vm == NULL)
857 continue;
861 if (!vm_map_trylock(&vm->vm_map))
862 goto nextproc1;
863
864 PROC_LOCK(p);
865 if (p->p_lock != 0 ||
866 (p->p_flag & (P_STOPPED_SINGLE|P_TRACED|P_SYSTEM|P_WEXIT)
867 ) != 0) {
868 goto nextproc2;

--- 151 unchanged lines hidden ---
858 if (!vm_map_trylock(&vm->vm_map))
859 goto nextproc1;
860
861 PROC_LOCK(p);
862 if (p->p_lock != 0 ||
863 (p->p_flag & (P_STOPPED_SINGLE|P_TRACED|P_SYSTEM|P_WEXIT)
864 ) != 0) {
865 goto nextproc2;

--- 151 unchanged lines hidden ---