2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
4 * Copyright (c) 2013 EMC Corp.
5 * Copyright (c) 2011 Jeffrey Roberson <jeff@freebsd.org>
6 * Copyright (c) 2008 Mayur Shardul <mayur.shardul@gmail.com>
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * Path-compressed radix trie implementation.
34 * The following code is not generalized into a general purpose library
35 * because there are way too many parameters embedded that should really
36 * be decided by the library consumers. At the same time, consumers
37 * of this code must achieve highest possible performance.
39 * The implementation takes into account the following rationale:
40 * - Size of the nodes should be as small as possible but still big enough
41 * to avoid a large maximum depth for the trie. This is a balance
42 * between the necessity to not wire too much physical memory for the nodes
43 * and the necessity to avoid too much cache pollution during the trie
45 * - There is not a huge bias toward the number of lookup operations over
46 * the number of insert and remove operations. This basically implies
47 * that optimizations supposedly helping one operation but hurting the
48 * other might be carefully evaluated.
49 * - On average not many nodes are expected to be fully populated, hence
50 * level compression may just complicate things.
53 #include <sys/cdefs.h>
54 __FBSDID("$FreeBSD$");
58 #include <sys/param.h>
59 #include <sys/systm.h>
60 #include <sys/kernel.h>
62 #include <sys/vmmeter.h>
64 #include <sys/smr_types.h>
68 #include <vm/vm_param.h>
69 #include <vm/vm_object.h>
70 #include <vm/vm_page.h>
71 #include <vm/vm_radix.h>
78 * These widths should allow the pointers to a node's children to fit within
79 * a single cache line. The extra levels from a narrow width should not be
80 * a problem thanks to path compression.
83 #define VM_RADIX_WIDTH 4
85 #define VM_RADIX_WIDTH 3
88 #define VM_RADIX_COUNT (1 << VM_RADIX_WIDTH)
89 #define VM_RADIX_MASK (VM_RADIX_COUNT - 1)
90 #define VM_RADIX_LIMIT \
91 (howmany(sizeof(vm_pindex_t) * NBBY, VM_RADIX_WIDTH) - 1)
93 /* Flag bits stored in node pointers. */
94 #define VM_RADIX_ISLEAF 0x1
95 #define VM_RADIX_FLAGS 0x1
96 #define VM_RADIX_PAD VM_RADIX_FLAGS
98 /* Returns one unit associated with specified level. */
99 #define VM_RADIX_UNITLEVEL(lev) \
100 ((vm_pindex_t)1 << ((lev) * VM_RADIX_WIDTH))
102 enum vm_radix_access { SMR, LOCKED, UNSERIALIZED };
104 struct vm_radix_node;
105 typedef SMR_POINTER(struct vm_radix_node *) smrnode_t;
107 struct vm_radix_node {
108 vm_pindex_t rn_owner; /* Owner of record. */
109 uint16_t rn_count; /* Valid children. */
110 uint8_t rn_clev; /* Current level. */
111 int8_t rn_last; /* zero last ptr. */
112 smrnode_t rn_child[VM_RADIX_COUNT]; /* Child nodes. */
115 static uma_zone_t vm_radix_node_zone;
116 static smr_t vm_radix_smr;
118 static void vm_radix_node_store(smrnode_t *p, struct vm_radix_node *v,
119 enum vm_radix_access access);
122 * Allocate a radix node.
124 static struct vm_radix_node *
125 vm_radix_node_get(vm_pindex_t owner, uint16_t count, uint16_t clevel)
127 struct vm_radix_node *rnode;
129 rnode = uma_zalloc_smr(vm_radix_node_zone, M_NOWAIT);
134 * We want to clear the last child pointer after the final section
135 * has exited so lookup can not return false negatives. It is done
136 * here because it will be cache-cold in the dtor callback.
138 if (rnode->rn_last != 0) {
139 vm_radix_node_store(&rnode->rn_child[rnode->rn_last - 1],
143 rnode->rn_owner = owner;
144 rnode->rn_count = count;
145 rnode->rn_clev = clevel;
153 vm_radix_node_put(struct vm_radix_node *rnode, int8_t last)
158 KASSERT(rnode->rn_count == 0,
159 ("vm_radix_node_put: rnode %p has %d children", rnode,
161 for (slot = 0; slot < VM_RADIX_COUNT; slot++) {
164 KASSERT(smr_unserialized_load(&rnode->rn_child[slot], true) ==
165 NULL, ("vm_radix_node_put: rnode %p has a child", rnode));
168 /* Off by one so a freshly zero'd node is not assigned to. */
169 rnode->rn_last = last + 1;
170 uma_zfree_smr(vm_radix_node_zone, rnode);
174 * Return the position in the array for a given level.
177 vm_radix_slot(vm_pindex_t index, uint16_t level)
180 return ((index >> (level * VM_RADIX_WIDTH)) & VM_RADIX_MASK);
183 /* Trims the key after the specified level. */
184 static __inline vm_pindex_t
185 vm_radix_trimkey(vm_pindex_t index, uint16_t level)
191 ret >>= level * VM_RADIX_WIDTH;
192 ret <<= level * VM_RADIX_WIDTH;
198 * Fetch a node pointer from a slot in another node.
200 static __inline struct vm_radix_node *
201 vm_radix_node_load(smrnode_t *p, enum vm_radix_access access)
206 return (smr_unserialized_load(p, true));
208 return (smr_serialized_load(p, true));
210 return (smr_entered_load(p, vm_radix_smr));
216 vm_radix_node_store(smrnode_t *p, struct vm_radix_node *v,
217 enum vm_radix_access access)
223 smr_unserialized_store(p, v, true);
226 smr_serialized_store(p, v, true);
229 panic("vm_radix_node_store: Not supported in smr section.");
234 * Get the root node for a radix tree.
236 static __inline struct vm_radix_node *
237 vm_radix_root_load(struct vm_radix *rtree, enum vm_radix_access access)
240 return (vm_radix_node_load((smrnode_t *)&rtree->rt_root, access));
244 * Set the root node for a radix tree.
247 vm_radix_root_store(struct vm_radix *rtree, struct vm_radix_node *rnode,
248 enum vm_radix_access access)
251 vm_radix_node_store((smrnode_t *)&rtree->rt_root, rnode, access);
255 * Returns TRUE if the specified radix node is a leaf and FALSE otherwise.
257 static __inline boolean_t
258 vm_radix_isleaf(struct vm_radix_node *rnode)
261 return (((uintptr_t)rnode & VM_RADIX_ISLEAF) != 0);
265 * Returns the associated page extracted from rnode.
267 static __inline vm_page_t
268 vm_radix_topage(struct vm_radix_node *rnode)
271 return ((vm_page_t)((uintptr_t)rnode & ~VM_RADIX_FLAGS));
275 * Adds the page as a child of the provided node.
278 vm_radix_addpage(struct vm_radix_node *rnode, vm_pindex_t index, uint16_t clev,
279 vm_page_t page, enum vm_radix_access access)
283 slot = vm_radix_slot(index, clev);
284 vm_radix_node_store(&rnode->rn_child[slot],
285 (struct vm_radix_node *)((uintptr_t)page | VM_RADIX_ISLEAF), access);
289 * Returns the slot where two keys differ.
290 * It cannot accept 2 equal keys.
292 static __inline uint16_t
293 vm_radix_keydiff(vm_pindex_t index1, vm_pindex_t index2)
297 KASSERT(index1 != index2, ("%s: passing the same key value %jx",
298 __func__, (uintmax_t)index1));
301 for (clev = VM_RADIX_LIMIT;; clev--)
302 if (vm_radix_slot(index1, clev) != 0)
307 * Returns TRUE if it can be determined that key does not belong to the
308 * specified rnode. Otherwise, returns FALSE.
310 static __inline boolean_t
311 vm_radix_keybarr(struct vm_radix_node *rnode, vm_pindex_t idx)
314 if (rnode->rn_clev < VM_RADIX_LIMIT) {
315 idx = vm_radix_trimkey(idx, rnode->rn_clev + 1);
316 return (idx != rnode->rn_owner);
322 * Internal helper for vm_radix_reclaim_allnodes().
323 * This function is recursive.
326 vm_radix_reclaim_allnodes_int(struct vm_radix_node *rnode)
328 struct vm_radix_node *child;
331 KASSERT(rnode->rn_count <= VM_RADIX_COUNT,
332 ("vm_radix_reclaim_allnodes_int: bad count in rnode %p", rnode));
333 for (slot = 0; rnode->rn_count != 0; slot++) {
334 child = vm_radix_node_load(&rnode->rn_child[slot], UNSERIALIZED);
337 if (!vm_radix_isleaf(child))
338 vm_radix_reclaim_allnodes_int(child);
339 vm_radix_node_store(&rnode->rn_child[slot], NULL, UNSERIALIZED);
342 vm_radix_node_put(rnode, -1);
345 #ifndef UMA_MD_SMALL_ALLOC
346 void vm_radix_reserve_kva(void);
348 * Reserve the KVA necessary to satisfy the node allocation.
349 * This is mandatory in architectures not supporting direct
350 * mapping as they will need otherwise to carve into the kernel maps for
351 * every node allocation, resulting into deadlocks for consumers already
352 * working with kernel maps.
355 vm_radix_reserve_kva(void)
359 * Calculate the number of reserved nodes, discounting the pages that
360 * are needed to store them.
362 if (!uma_zone_reserve_kva(vm_radix_node_zone,
363 ((vm_paddr_t)vm_cnt.v_page_count * PAGE_SIZE) / (PAGE_SIZE +
364 sizeof(struct vm_radix_node))))
365 panic("%s: unable to reserve KVA", __func__);
370 * Initialize the UMA slab zone.
376 vm_radix_node_zone = uma_zcreate("RADIX NODE",
377 sizeof(struct vm_radix_node), NULL, NULL, NULL, NULL,
378 VM_RADIX_PAD, UMA_ZONE_VM | UMA_ZONE_SMR | UMA_ZONE_ZINIT);
379 vm_radix_smr = uma_zone_get_smr(vm_radix_node_zone);
383 * Inserts the key-value pair into the trie.
384 * Panics if the key already exists.
387 vm_radix_insert(struct vm_radix *rtree, vm_page_t page)
389 vm_pindex_t index, newind;
390 struct vm_radix_node *rnode, *tmp;
396 index = page->pindex;
399 * The owner of record for root is not really important because it
400 * will never be used.
402 rnode = vm_radix_root_load(rtree, LOCKED);
404 rtree->rt_root = (uintptr_t)page | VM_RADIX_ISLEAF;
407 parentp = (smrnode_t *)&rtree->rt_root;
409 if (vm_radix_isleaf(rnode)) {
410 m = vm_radix_topage(rnode);
411 if (m->pindex == index)
412 panic("%s: key %jx is already present",
413 __func__, (uintmax_t)index);
414 clev = vm_radix_keydiff(m->pindex, index);
415 tmp = vm_radix_node_get(vm_radix_trimkey(index,
419 /* These writes are not yet visible due to ordering. */
420 vm_radix_addpage(tmp, index, clev, page, UNSERIALIZED);
421 vm_radix_addpage(tmp, m->pindex, clev, m, UNSERIALIZED);
422 /* Synchronize to make leaf visible. */
423 vm_radix_node_store(parentp, tmp, LOCKED);
425 } else if (vm_radix_keybarr(rnode, index))
427 slot = vm_radix_slot(index, rnode->rn_clev);
428 parentp = &rnode->rn_child[slot];
429 tmp = vm_radix_node_load(parentp, LOCKED);
432 vm_radix_addpage(rnode, index, rnode->rn_clev, page,
440 * A new node is needed because the right insertion level is reached.
441 * Setup the new intermediate node and add the 2 children: the
442 * new object and the older edge.
444 newind = rnode->rn_owner;
445 clev = vm_radix_keydiff(newind, index);
446 tmp = vm_radix_node_get(vm_radix_trimkey(index, clev + 1), 2, clev);
449 slot = vm_radix_slot(newind, clev);
450 /* These writes are not yet visible due to ordering. */
451 vm_radix_addpage(tmp, index, clev, page, UNSERIALIZED);
452 vm_radix_node_store(&tmp->rn_child[slot], rnode, UNSERIALIZED);
453 /* Serializing write to make the above visible. */
454 vm_radix_node_store(parentp, tmp, LOCKED);
460 * Returns TRUE if the specified radix tree contains a single leaf and FALSE
464 vm_radix_is_singleton(struct vm_radix *rtree)
466 struct vm_radix_node *rnode;
468 rnode = vm_radix_root_load(rtree, LOCKED);
471 return (vm_radix_isleaf(rnode));
475 * Returns the value stored at the index. If the index is not present,
478 static __always_inline vm_page_t
479 _vm_radix_lookup(struct vm_radix *rtree, vm_pindex_t index,
480 enum vm_radix_access access)
482 struct vm_radix_node *rnode;
486 rnode = vm_radix_root_load(rtree, access);
487 while (rnode != NULL) {
488 if (vm_radix_isleaf(rnode)) {
489 m = vm_radix_topage(rnode);
490 if (m->pindex == index)
494 if (vm_radix_keybarr(rnode, index))
496 slot = vm_radix_slot(index, rnode->rn_clev);
497 rnode = vm_radix_node_load(&rnode->rn_child[slot], access);
503 * Returns the value stored at the index assuming there is an external lock.
505 * If the index is not present, NULL is returned.
508 vm_radix_lookup(struct vm_radix *rtree, vm_pindex_t index)
511 return _vm_radix_lookup(rtree, index, LOCKED);
515 * Returns the value stored at the index without requiring an external lock.
517 * If the index is not present, NULL is returned.
520 vm_radix_lookup_unlocked(struct vm_radix *rtree, vm_pindex_t index)
524 smr_enter(vm_radix_smr);
525 m = _vm_radix_lookup(rtree, index, SMR);
526 smr_exit(vm_radix_smr);
532 * Look up the nearest entry at a position greater than or equal to index.
535 vm_radix_lookup_ge(struct vm_radix *rtree, vm_pindex_t index)
537 struct vm_radix_node *stack[VM_RADIX_LIMIT];
540 struct vm_radix_node *child, *rnode;
546 rnode = vm_radix_root_load(rtree, LOCKED);
549 else if (vm_radix_isleaf(rnode)) {
550 m = vm_radix_topage(rnode);
551 if (m->pindex >= index)
559 * If the keys differ before the current bisection node,
560 * then the search key might rollback to the earliest
561 * available bisection node or to the smallest key
562 * in the current node (if the owner is greater than the
565 if (vm_radix_keybarr(rnode, index)) {
566 if (index > rnode->rn_owner) {
568 KASSERT(++loops < 1000,
569 ("vm_radix_lookup_ge: too many loops"));
572 * Pop nodes from the stack until either the
573 * stack is empty or a node that could have a
574 * matching descendant is found.
579 rnode = stack[--tos];
580 } while (vm_radix_slot(index,
581 rnode->rn_clev) == (VM_RADIX_COUNT - 1));
584 * The following computation cannot overflow
585 * because index's slot at the current level
586 * is less than VM_RADIX_COUNT - 1.
588 index = vm_radix_trimkey(index,
590 index += VM_RADIX_UNITLEVEL(rnode->rn_clev);
592 index = rnode->rn_owner;
593 KASSERT(!vm_radix_keybarr(rnode, index),
594 ("vm_radix_lookup_ge: keybarr failed"));
596 slot = vm_radix_slot(index, rnode->rn_clev);
597 child = vm_radix_node_load(&rnode->rn_child[slot], LOCKED);
598 if (vm_radix_isleaf(child)) {
599 m = vm_radix_topage(child);
600 if (m->pindex >= index)
602 } else if (child != NULL)
606 * Look for an available edge or page within the current
609 if (slot < (VM_RADIX_COUNT - 1)) {
610 inc = VM_RADIX_UNITLEVEL(rnode->rn_clev);
611 index = vm_radix_trimkey(index, rnode->rn_clev);
615 child = vm_radix_node_load(&rnode->rn_child[slot],
617 if (vm_radix_isleaf(child)) {
618 m = vm_radix_topage(child);
619 if (m->pindex >= index)
621 } else if (child != NULL)
623 } while (slot < (VM_RADIX_COUNT - 1));
625 KASSERT(child == NULL || vm_radix_isleaf(child),
626 ("vm_radix_lookup_ge: child is radix node"));
629 * If a page or edge greater than the search slot is not found
630 * in the current node, ascend to the next higher-level node.
634 KASSERT(rnode->rn_clev > 0,
635 ("vm_radix_lookup_ge: pushing leaf's parent"));
636 KASSERT(tos < VM_RADIX_LIMIT,
637 ("vm_radix_lookup_ge: stack overflow"));
638 stack[tos++] = rnode;
644 * Look up the nearest entry at a position less than or equal to index.
647 vm_radix_lookup_le(struct vm_radix *rtree, vm_pindex_t index)
649 struct vm_radix_node *stack[VM_RADIX_LIMIT];
652 struct vm_radix_node *child, *rnode;
658 rnode = vm_radix_root_load(rtree, LOCKED);
661 else if (vm_radix_isleaf(rnode)) {
662 m = vm_radix_topage(rnode);
663 if (m->pindex <= index)
671 * If the keys differ before the current bisection node,
672 * then the search key might rollback to the earliest
673 * available bisection node or to the largest key
674 * in the current node (if the owner is smaller than the
677 if (vm_radix_keybarr(rnode, index)) {
678 if (index > rnode->rn_owner) {
679 index = rnode->rn_owner + VM_RADIX_COUNT *
680 VM_RADIX_UNITLEVEL(rnode->rn_clev);
683 KASSERT(++loops < 1000,
684 ("vm_radix_lookup_le: too many loops"));
687 * Pop nodes from the stack until either the
688 * stack is empty or a node that could have a
689 * matching descendant is found.
694 rnode = stack[--tos];
695 } while (vm_radix_slot(index,
696 rnode->rn_clev) == 0);
699 * The following computation cannot overflow
700 * because index's slot at the current level
703 index = vm_radix_trimkey(index,
707 KASSERT(!vm_radix_keybarr(rnode, index),
708 ("vm_radix_lookup_le: keybarr failed"));
710 slot = vm_radix_slot(index, rnode->rn_clev);
711 child = vm_radix_node_load(&rnode->rn_child[slot], LOCKED);
712 if (vm_radix_isleaf(child)) {
713 m = vm_radix_topage(child);
714 if (m->pindex <= index)
716 } else if (child != NULL)
720 * Look for an available edge or page within the current
724 inc = VM_RADIX_UNITLEVEL(rnode->rn_clev);
729 child = vm_radix_node_load(&rnode->rn_child[slot],
731 if (vm_radix_isleaf(child)) {
732 m = vm_radix_topage(child);
733 if (m->pindex <= index)
735 } else if (child != NULL)
739 KASSERT(child == NULL || vm_radix_isleaf(child),
740 ("vm_radix_lookup_le: child is radix node"));
743 * If a page or edge smaller than the search slot is not found
744 * in the current node, ascend to the next higher-level node.
748 KASSERT(rnode->rn_clev > 0,
749 ("vm_radix_lookup_le: pushing leaf's parent"));
750 KASSERT(tos < VM_RADIX_LIMIT,
751 ("vm_radix_lookup_le: stack overflow"));
752 stack[tos++] = rnode;
758 * Remove the specified index from the trie, and return the value stored at
759 * that index. If the index is not present, return NULL.
762 vm_radix_remove(struct vm_radix *rtree, vm_pindex_t index)
764 struct vm_radix_node *rnode, *parent, *tmp;
768 rnode = vm_radix_root_load(rtree, LOCKED);
769 if (vm_radix_isleaf(rnode)) {
770 m = vm_radix_topage(rnode);
771 if (m->pindex != index)
773 vm_radix_root_store(rtree, NULL, LOCKED);
780 slot = vm_radix_slot(index, rnode->rn_clev);
781 tmp = vm_radix_node_load(&rnode->rn_child[slot], LOCKED);
782 if (vm_radix_isleaf(tmp)) {
783 m = vm_radix_topage(tmp);
784 if (m->pindex != index)
786 vm_radix_node_store(&rnode->rn_child[slot], NULL, LOCKED);
788 if (rnode->rn_count > 1)
790 for (i = 0; i < VM_RADIX_COUNT; i++)
791 if (vm_radix_node_load(&rnode->rn_child[i],
794 KASSERT(i != VM_RADIX_COUNT,
795 ("%s: invalid node configuration", __func__));
796 tmp = vm_radix_node_load(&rnode->rn_child[i], LOCKED);
798 vm_radix_root_store(rtree, tmp, LOCKED);
800 slot = vm_radix_slot(index, parent->rn_clev);
801 KASSERT(vm_radix_node_load(
802 &parent->rn_child[slot], LOCKED) == rnode,
803 ("%s: invalid child value", __func__));
804 vm_radix_node_store(&parent->rn_child[slot],
808 * The child is still valid and we can not zero the
809 * pointer until all smr references are gone.
812 vm_radix_node_put(rnode, i);
821 * Remove and free all the nodes from the radix tree.
822 * This function is recursive but there is a tight control on it as the
823 * maximum depth of the tree is fixed.
826 vm_radix_reclaim_allnodes(struct vm_radix *rtree)
828 struct vm_radix_node *root;
830 root = vm_radix_root_load(rtree, LOCKED);
833 vm_radix_root_store(rtree, NULL, UNSERIALIZED);
834 if (!vm_radix_isleaf(root))
835 vm_radix_reclaim_allnodes_int(root);
839 * Replace an existing page in the trie with another one.
840 * Panics if there is not an old page in the trie at the new page's index.
843 vm_radix_replace(struct vm_radix *rtree, vm_page_t newpage)
845 struct vm_radix_node *rnode, *tmp;
850 index = newpage->pindex;
851 rnode = vm_radix_root_load(rtree, LOCKED);
853 panic("%s: replacing page on an empty trie", __func__);
854 if (vm_radix_isleaf(rnode)) {
855 m = vm_radix_topage(rnode);
856 if (m->pindex != index)
857 panic("%s: original replacing root key not found",
859 rtree->rt_root = (uintptr_t)newpage | VM_RADIX_ISLEAF;
863 slot = vm_radix_slot(index, rnode->rn_clev);
864 tmp = vm_radix_node_load(&rnode->rn_child[slot], LOCKED);
865 if (vm_radix_isleaf(tmp)) {
866 m = vm_radix_topage(tmp);
867 if (m->pindex == index) {
868 vm_radix_node_store(&rnode->rn_child[slot],
869 (struct vm_radix_node *)((uintptr_t)newpage |
870 VM_RADIX_ISLEAF), LOCKED);
874 } else if (tmp == NULL || vm_radix_keybarr(tmp, index))
878 panic("%s: original replacing page not found", __func__);
884 uma_zwait(vm_radix_node_zone);
889 * Show details about the given radix node.
891 DB_SHOW_COMMAND(radixnode, db_show_radixnode)
893 struct vm_radix_node *rnode, *tmp;
898 rnode = (struct vm_radix_node *)addr;
899 db_printf("radixnode %p, owner %jx, children count %u, level %u:\n",
900 (void *)rnode, (uintmax_t)rnode->rn_owner, rnode->rn_count,
902 for (i = 0; i < VM_RADIX_COUNT; i++) {
903 tmp = vm_radix_node_load(&rnode->rn_child[i], UNSERIALIZED);
905 db_printf("slot: %d, val: %p, page: %p, clev: %d\n",
907 vm_radix_isleaf(tmp) ? vm_radix_topage(tmp) : NULL,