Deleted Added
full compact
vm_radix.c (246835) vm_radix.c (246836)
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

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

110/*
111 * Boot-time cache of struct vm_radix_node objects.
112 * This cache is used to cater page allocations before the UMA zone is
113 * actually setup and pre-allocated (ie. pmap_init()).
114 */
115static u_int boot_cache_cnt;
116static struct vm_radix_node boot_cache[VM_RADIX_BOOT_CACHE];
117
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

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

110/*
111 * Boot-time cache of struct vm_radix_node objects.
112 * This cache is used to cater page allocations before the UMA zone is
113 * actually setup and pre-allocated (ie. pmap_init()).
114 */
115static u_int boot_cache_cnt;
116static struct vm_radix_node boot_cache[VM_RADIX_BOOT_CACHE];
117
118#ifdef INVARIANTS
119/*
120 * Radix node zone destructor.
121 */
122static void
123vm_radix_node_zone_dtor(void *mem, int size __unused, void *arg __unused)
124{
125 struct vm_radix_node *rnode;
126
127 rnode = mem;
128 KASSERT(rnode->rn_count == 0,
129 ("vm_radix_node_put: Freeing node %p with %d children\n", mem,
130 rnode->rn_count));
131}
132#endif
133
134static struct vm_radix_node *
135vm_radix_carve_bootcache(void)
136{
137 struct vm_radix_node *rnode;
138
139 if (boot_cache_cnt == VM_RADIX_BOOT_CACHE)
140 panic("%s: Increase VM_RADIX_BOOT_CACHE (%u)", __func__,
141 VM_RADIX_BOOT_CACHE);

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

368 continue;
369 if (vm_radix_node_page(rnode->rn_child[slot]) == NULL)
370 vm_radix_reclaim_allnodes_int(rnode->rn_child[slot]);
371 rnode->rn_count--;
372 }
373 vm_radix_node_put(rnode);
374}
375
118static struct vm_radix_node *
119vm_radix_carve_bootcache(void)
120{
121 struct vm_radix_node *rnode;
122
123 if (boot_cache_cnt == VM_RADIX_BOOT_CACHE)
124 panic("%s: Increase VM_RADIX_BOOT_CACHE (%u)", __func__,
125 VM_RADIX_BOOT_CACHE);

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

352 continue;
353 if (vm_radix_node_page(rnode->rn_child[slot]) == NULL)
354 vm_radix_reclaim_allnodes_int(rnode->rn_child[slot]);
355 rnode->rn_count--;
356 }
357 vm_radix_node_put(rnode);
358}
359
360#ifdef INVARIANTS
376/*
361/*
362 * Radix node zone destructor.
363 */
364static void
365vm_radix_node_zone_dtor(void *mem, int size __unused, void *arg __unused)
366{
367 struct vm_radix_node *rnode;
368
369 rnode = mem;
370 KASSERT(rnode->rn_count == 0,
371 ("vm_radix_node_put: Freeing node %p with %d children\n", mem,
372 rnode->rn_count));
373}
374#endif
375
376/*
377 * Pre-allocate intermediate nodes from the UMA slab zone.
378 */
379static void
380vm_radix_init(void *arg __unused)
381{
382 int nitems;
383
384 vm_radix_node_zone = uma_zcreate("RADIX NODE",

--- 398 unchanged lines hidden ---
377 * Pre-allocate intermediate nodes from the UMA slab zone.
378 */
379static void
380vm_radix_init(void *arg __unused)
381{
382 int nitems;
383
384 vm_radix_node_zone = uma_zcreate("RADIX NODE",

--- 398 unchanged lines hidden ---