Deleted Added
full compact
vm_radix.c (249502) vm_radix.c (249605)
1/*
2 * Copyright (c) 2013 EMC Corp.
3 * Copyright (c) 2011 Jeffrey Roberson <jeff@freebsd.org>
4 * Copyright (c) 2008 Mayur Shardul <mayur.shardul@gmail.com>
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

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

44 * the number of insert and remove operations. This basically implies
45 * that optimizations supposedly helping one operation but hurting the
46 * other might be carefully evaluated.
47 * - On average not many nodes are expected to be fully populated, hence
48 * level compression may just complicate things.
49 */
50
51#include <sys/cdefs.h>
1/*
2 * Copyright (c) 2013 EMC Corp.
3 * Copyright (c) 2011 Jeffrey Roberson <jeff@freebsd.org>
4 * Copyright (c) 2008 Mayur Shardul <mayur.shardul@gmail.com>
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

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

44 * the number of insert and remove operations. This basically implies
45 * that optimizations supposedly helping one operation but hurting the
46 * other might be carefully evaluated.
47 * - On average not many nodes are expected to be fully populated, hence
48 * level compression may just complicate things.
49 */
50
51#include <sys/cdefs.h>
52__FBSDID("$FreeBSD: head/sys/vm/vm_radix.c 249502 2013-04-15 06:12:00Z alc $");
52__FBSDID("$FreeBSD: head/sys/vm/vm_radix.c 249605 2013-04-18 05:34:33Z alc $");
53
54#include "opt_ddb.h"
55
56#include <sys/param.h>
57#include <sys/systm.h>
58#include <sys/kernel.h>
59#include <sys/vmmeter.h>
60

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

355}
356
357/*
358 * Pre-allocate intermediate nodes from the UMA slab zone.
359 */
360static void
361vm_radix_prealloc(void *arg __unused)
362{
53
54#include "opt_ddb.h"
55
56#include <sys/param.h>
57#include <sys/systm.h>
58#include <sys/kernel.h>
59#include <sys/vmmeter.h>
60

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

355}
356
357/*
358 * Pre-allocate intermediate nodes from the UMA slab zone.
359 */
360static void
361vm_radix_prealloc(void *arg __unused)
362{
363 int nodes;
363
364
364 if (!uma_zone_reserve_kva(vm_radix_node_zone, cnt.v_page_count))
365 /*
366 * Calculate the number of reserved nodes, discounting the pages that
367 * are needed to store them.
368 */
369 nodes = ((vm_paddr_t)cnt.v_page_count * PAGE_SIZE) / (PAGE_SIZE +
370 sizeof(struct vm_radix_node));
371 if (!uma_zone_reserve_kva(vm_radix_node_zone, nodes))
365 panic("%s: unable to create new zone", __func__);
372 panic("%s: unable to create new zone", __func__);
366 uma_prealloc(vm_radix_node_zone, cnt.v_page_count);
373 uma_prealloc(vm_radix_node_zone, nodes);
367}
368SYSINIT(vm_radix_prealloc, SI_SUB_KMEM, SI_ORDER_SECOND, vm_radix_prealloc,
369 NULL);
370
371/*
372 * Initialize the UMA slab zone.
373 * Until vm_radix_prealloc() is called, the zone will be served by the
374 * UMA boot-time pre-allocated pool of pages.

--- 409 unchanged lines hidden ---
374}
375SYSINIT(vm_radix_prealloc, SI_SUB_KMEM, SI_ORDER_SECOND, vm_radix_prealloc,
376 NULL);
377
378/*
379 * Initialize the UMA slab zone.
380 * Until vm_radix_prealloc() is called, the zone will be served by the
381 * UMA boot-time pre-allocated pool of pages.

--- 409 unchanged lines hidden ---