Deleted Added
full compact
vm_kern.c (128613) vm_kern.c (129906)
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

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

58 * rights to redistribute these changes.
59 */
60
61/*
62 * Kernel memory management.
63 */
64
65#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

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

58 * rights to redistribute these changes.
59 */
60
61/*
62 * Kernel memory management.
63 */
64
65#include <sys/cdefs.h>
66__FBSDID("$FreeBSD: head/sys/vm/vm_kern.c 128613 2004-04-24 20:53:55Z alc $");
66__FBSDID("$FreeBSD: head/sys/vm/vm_kern.c 129906 2004-05-31 21:46:06Z bmilekic $");
67
68#include <sys/param.h>
69#include <sys/systm.h>
70#include <sys/kernel.h> /* for ticks and hz */
71#include <sys/lock.h>
72#include <sys/mutex.h>
73#include <sys/proc.h>
74#include <sys/malloc.h>

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

315 /*
316 * Locate sufficient space in the map. This will give us the final
317 * virtual address for the new memory, and thus will tell us the
318 * offset within the kernel map.
319 */
320 vm_map_lock(map);
321 if (vm_map_findspace(map, vm_map_min(map), size, &addr)) {
322 vm_map_unlock(map);
67
68#include <sys/param.h>
69#include <sys/systm.h>
70#include <sys/kernel.h> /* for ticks and hz */
71#include <sys/lock.h>
72#include <sys/mutex.h>
73#include <sys/proc.h>
74#include <sys/malloc.h>

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

315 /*
316 * Locate sufficient space in the map. This will give us the final
317 * virtual address for the new memory, and thus will tell us the
318 * offset within the kernel map.
319 */
320 vm_map_lock(map);
321 if (vm_map_findspace(map, vm_map_min(map), size, &addr)) {
322 vm_map_unlock(map);
323 if (map != kmem_map) {
324 static int last_report; /* when we did it (in ticks) */
325 if (ticks < last_report ||
326 (ticks - last_report) >= hz) {
327 last_report = ticks;
328 printf("Out of mbuf address space!\n");
329 printf("Consider increasing NMBCLUSTERS\n");
330 }
331 return (0);
332 }
333 if ((flags & M_NOWAIT) == 0)
334 panic("kmem_malloc(%ld): kmem_map too small: %ld total allocated",
335 (long)size, (long)map->size);
336 return (0);
337 }
338 offset = addr - VM_MIN_KERNEL_ADDRESS;
339 vm_object_reference(kmem_object);
340 vm_map_insert(map, kmem_object, offset, addr, addr + size,

--- 193 unchanged lines hidden ---
323 if ((flags & M_NOWAIT) == 0)
324 panic("kmem_malloc(%ld): kmem_map too small: %ld total allocated",
325 (long)size, (long)map->size);
326 return (0);
327 }
328 offset = addr - VM_MIN_KERNEL_ADDRESS;
329 vm_object_reference(kmem_object);
330 vm_map_insert(map, kmem_object, offset, addr, addr + size,

--- 193 unchanged lines hidden ---