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>
67 #include <vm/vm_param.h>
68 #include <vm/vm_object.h>
69 #include <vm/vm_page.h>
70 #include <vm/vm_radix.h>
77 * These widths should allow the pointers to a node's children to fit within
78 * a single cache line. The extra levels from a narrow width should not be
79 * a problem thanks to path compression.
82 #define VM_RADIX_WIDTH 4
84 #define VM_RADIX_WIDTH 3
87 #define VM_RADIX_COUNT (1 << VM_RADIX_WIDTH)
88 #define VM_RADIX_MASK (VM_RADIX_COUNT - 1)
89 #define VM_RADIX_LIMIT \
90 (howmany(sizeof(vm_pindex_t) * NBBY, VM_RADIX_WIDTH) - 1)
92 /* Flag bits stored in node pointers. */
93 #define VM_RADIX_ISLEAF 0x1
94 #define VM_RADIX_FLAGS 0x1
95 #define VM_RADIX_PAD VM_RADIX_FLAGS
97 /* Returns one unit associated with specified level. */
98 #define VM_RADIX_UNITLEVEL(lev) \
99 ((vm_pindex_t)1 << ((lev) * VM_RADIX_WIDTH))
101 enum vm_radix_access { SMR, LOCKED, UNSERIALIZED };
103 struct vm_radix_node;
104 SMR_TYPE_DECLARE(smrnode_t, struct vm_radix_node *);
106 struct vm_radix_node {
107 vm_pindex_t rn_owner; /* Owner of record. */
108 uint16_t rn_count; /* Valid children. */
109 uint8_t rn_clev; /* Current level. */
110 int8_t rn_last; /* zero last ptr. */
111 smrnode_t rn_child[VM_RADIX_COUNT]; /* Child nodes. */
114 static uma_zone_t vm_radix_node_zone;
115 static smr_t vm_radix_smr;
117 static void vm_radix_node_store(smrnode_t *p, struct vm_radix_node *v,
118 enum vm_radix_access access);
121 * Allocate a radix node.
123 static struct vm_radix_node *
124 vm_radix_node_get(vm_pindex_t owner, uint16_t count, uint16_t clevel)
126 struct vm_radix_node *rnode;
128 rnode = uma_zalloc_smr(vm_radix_node_zone, M_NOWAIT);
133 * We want to clear the last child pointer after the final section
134 * has exited so lookup can not return false negatives. It is done
135 * here because it will be cache-cold in the dtor callback.
137 if (rnode->rn_last != 0) {
138 vm_radix_node_store(&rnode->rn_child[rnode->rn_last - 1],
142 rnode->rn_owner = owner;
143 rnode->rn_count = count;
144 rnode->rn_clev = clevel;
152 vm_radix_node_put(struct vm_radix_node *rnode, int8_t last)
157 KASSERT(rnode->rn_count == 0,
158 ("vm_radix_node_put: rnode %p has %d children", rnode,
160 for (slot = 0; slot < VM_RADIX_COUNT; slot++) {
163 KASSERT(smr_unserialized_load(&rnode->rn_child[slot], true) ==
164 NULL, ("vm_radix_node_put: rnode %p has a child", rnode));
167 /* Off by one so a freshly zero'd node is not assigned to. */
168 rnode->rn_last = last + 1;
169 uma_zfree_smr(vm_radix_node_zone, rnode);
173 * Return the position in the array for a given level.
176 vm_radix_slot(vm_pindex_t index, uint16_t level)
179 return ((index >> (level * VM_RADIX_WIDTH)) & VM_RADIX_MASK);
182 /* Trims the key after the specified level. */
183 static __inline vm_pindex_t
184 vm_radix_trimkey(vm_pindex_t index, uint16_t level)
190 ret >>= level * VM_RADIX_WIDTH;
191 ret <<= level * VM_RADIX_WIDTH;
197 * Fetch a node pointer from a slot in another node.
199 static __inline struct vm_radix_node *
200 vm_radix_node_load(smrnode_t *p, enum vm_radix_access access)
205 return (smr_unserialized_load(p, true));
207 return (smr_serialized_load(p, true));
209 return (smr_entered_load(p, vm_radix_smr));
214 vm_radix_node_store(smrnode_t *p, struct vm_radix_node *v,
215 enum vm_radix_access access)
221 smr_unserialized_store(p, v, true);
224 smr_serialized_store(p, v, true);
227 panic("vm_radix_node_store: Not supported in smr section.");
232 * Get the root node for a radix tree.
234 static __inline struct vm_radix_node *
235 vm_radix_root_load(struct vm_radix *rtree, enum vm_radix_access access)
238 return (vm_radix_node_load((smrnode_t *)&rtree->rt_root, access));
242 * Set the root node for a radix tree.
245 vm_radix_root_store(struct vm_radix *rtree, struct vm_radix_node *rnode,
246 enum vm_radix_access access)
249 vm_radix_node_store((smrnode_t *)&rtree->rt_root, rnode, access);
253 * Returns TRUE if the specified radix node is a leaf and FALSE otherwise.
255 static __inline boolean_t
256 vm_radix_isleaf(struct vm_radix_node *rnode)
259 return (((uintptr_t)rnode & VM_RADIX_ISLEAF) != 0);
263 * Returns the associated page extracted from rnode.
265 static __inline vm_page_t
266 vm_radix_topage(struct vm_radix_node *rnode)
269 return ((vm_page_t)((uintptr_t)rnode & ~VM_RADIX_FLAGS));
273 * Adds the page as a child of the provided node.
276 vm_radix_addpage(struct vm_radix_node *rnode, vm_pindex_t index, uint16_t clev,
277 vm_page_t page, enum vm_radix_access access)
281 slot = vm_radix_slot(index, clev);
282 vm_radix_node_store(&rnode->rn_child[slot],
283 (struct vm_radix_node *)((uintptr_t)page | VM_RADIX_ISLEAF), access);
287 * Returns the slot where two keys differ.
288 * It cannot accept 2 equal keys.
290 static __inline uint16_t
291 vm_radix_keydiff(vm_pindex_t index1, vm_pindex_t index2)
295 KASSERT(index1 != index2, ("%s: passing the same key value %jx",
296 __func__, (uintmax_t)index1));
299 for (clev = VM_RADIX_LIMIT;; clev--)
300 if (vm_radix_slot(index1, clev) != 0)
305 * Returns TRUE if it can be determined that key does not belong to the
306 * specified rnode. Otherwise, returns FALSE.
308 static __inline boolean_t
309 vm_radix_keybarr(struct vm_radix_node *rnode, vm_pindex_t idx)
312 if (rnode->rn_clev < VM_RADIX_LIMIT) {
313 idx = vm_radix_trimkey(idx, rnode->rn_clev + 1);
314 return (idx != rnode->rn_owner);
320 * Internal helper for vm_radix_reclaim_allnodes().
321 * This function is recursive.
324 vm_radix_reclaim_allnodes_int(struct vm_radix_node *rnode)
326 struct vm_radix_node *child;
329 KASSERT(rnode->rn_count <= VM_RADIX_COUNT,
330 ("vm_radix_reclaim_allnodes_int: bad count in rnode %p", rnode));
331 for (slot = 0; rnode->rn_count != 0; slot++) {
332 child = vm_radix_node_load(&rnode->rn_child[slot], UNSERIALIZED);
335 if (!vm_radix_isleaf(child))
336 vm_radix_reclaim_allnodes_int(child);
337 vm_radix_node_store(&rnode->rn_child[slot], NULL, UNSERIALIZED);
340 vm_radix_node_put(rnode, -1);
343 #ifndef UMA_MD_SMALL_ALLOC
344 void vm_radix_reserve_kva(void);
346 * Reserve the KVA necessary to satisfy the node allocation.
347 * This is mandatory in architectures not supporting direct
348 * mapping as they will need otherwise to carve into the kernel maps for
349 * every node allocation, resulting into deadlocks for consumers already
350 * working with kernel maps.
353 vm_radix_reserve_kva(void)
357 * Calculate the number of reserved nodes, discounting the pages that
358 * are needed to store them.
360 if (!uma_zone_reserve_kva(vm_radix_node_zone,
361 ((vm_paddr_t)vm_cnt.v_page_count * PAGE_SIZE) / (PAGE_SIZE +
362 sizeof(struct vm_radix_node))))
363 panic("%s: unable to reserve KVA", __func__);
368 * Initialize the UMA slab zone.
374 vm_radix_node_zone = uma_zcreate("RADIX NODE",
375 sizeof(struct vm_radix_node), NULL, NULL, NULL, NULL,
376 VM_RADIX_PAD, UMA_ZONE_VM | UMA_ZONE_SMR | UMA_ZONE_ZINIT);
377 vm_radix_smr = uma_zone_get_smr(vm_radix_node_zone);
381 * Inserts the key-value pair into the trie.
382 * Panics if the key already exists.
385 vm_radix_insert(struct vm_radix *rtree, vm_page_t page)
387 vm_pindex_t index, newind;
388 struct vm_radix_node *rnode, *tmp;
394 index = page->pindex;
397 * The owner of record for root is not really important because it
398 * will never be used.
400 rnode = vm_radix_root_load(rtree, LOCKED);
402 rtree->rt_root = (uintptr_t)page | VM_RADIX_ISLEAF;
405 parentp = (smrnode_t *)&rtree->rt_root;
407 if (vm_radix_isleaf(rnode)) {
408 m = vm_radix_topage(rnode);
409 if (m->pindex == index)
410 panic("%s: key %jx is already present",
411 __func__, (uintmax_t)index);
412 clev = vm_radix_keydiff(m->pindex, index);
413 tmp = vm_radix_node_get(vm_radix_trimkey(index,
417 /* These writes are not yet visible due to ordering. */
418 vm_radix_addpage(tmp, index, clev, page, UNSERIALIZED);
419 vm_radix_addpage(tmp, m->pindex, clev, m, UNSERIALIZED);
420 /* Synchronize to make leaf visible. */
421 vm_radix_node_store(parentp, tmp, LOCKED);
423 } else if (vm_radix_keybarr(rnode, index))
425 slot = vm_radix_slot(index, rnode->rn_clev);
426 parentp = &rnode->rn_child[slot];
427 tmp = vm_radix_node_load(parentp, LOCKED);
430 vm_radix_addpage(rnode, index, rnode->rn_clev, page,
438 * A new node is needed because the right insertion level is reached.
439 * Setup the new intermediate node and add the 2 children: the
440 * new object and the older edge.
442 newind = rnode->rn_owner;
443 clev = vm_radix_keydiff(newind, index);
444 tmp = vm_radix_node_get(vm_radix_trimkey(index, clev + 1), 2, clev);
447 slot = vm_radix_slot(newind, clev);
448 /* These writes are not yet visible due to ordering. */
449 vm_radix_addpage(tmp, index, clev, page, UNSERIALIZED);
450 vm_radix_node_store(&tmp->rn_child[slot], rnode, UNSERIALIZED);
451 /* Serializing write to make the above visible. */
452 vm_radix_node_store(parentp, tmp, LOCKED);
458 * Returns TRUE if the specified radix tree contains a single leaf and FALSE
462 vm_radix_is_singleton(struct vm_radix *rtree)
464 struct vm_radix_node *rnode;
466 rnode = vm_radix_root_load(rtree, LOCKED);
469 return (vm_radix_isleaf(rnode));
473 * Returns the value stored at the index. If the index is not present,
476 static __always_inline vm_page_t
477 _vm_radix_lookup(struct vm_radix *rtree, vm_pindex_t index,
478 enum vm_radix_access access)
480 struct vm_radix_node *rnode;
484 rnode = vm_radix_root_load(rtree, access);
485 while (rnode != NULL) {
486 if (vm_radix_isleaf(rnode)) {
487 m = vm_radix_topage(rnode);
488 if (m->pindex == index)
492 if (vm_radix_keybarr(rnode, index))
494 slot = vm_radix_slot(index, rnode->rn_clev);
495 rnode = vm_radix_node_load(&rnode->rn_child[slot], access);
501 * Returns the value stored at the index assuming there is an external lock.
503 * If the index is not present, NULL is returned.
506 vm_radix_lookup(struct vm_radix *rtree, vm_pindex_t index)
509 return _vm_radix_lookup(rtree, index, LOCKED);
513 * Returns the value stored at the index without requiring an external lock.
515 * If the index is not present, NULL is returned.
518 vm_radix_lookup_unlocked(struct vm_radix *rtree, vm_pindex_t index)
522 smr_enter(vm_radix_smr);
523 m = _vm_radix_lookup(rtree, index, SMR);
524 smr_exit(vm_radix_smr);
530 * Look up the nearest entry at a position greater than or equal to index.
533 vm_radix_lookup_ge(struct vm_radix *rtree, vm_pindex_t index)
535 struct vm_radix_node *stack[VM_RADIX_LIMIT];
538 struct vm_radix_node *child, *rnode;
544 rnode = vm_radix_root_load(rtree, LOCKED);
547 else if (vm_radix_isleaf(rnode)) {
548 m = vm_radix_topage(rnode);
549 if (m->pindex >= index)
557 * If the keys differ before the current bisection node,
558 * then the search key might rollback to the earliest
559 * available bisection node or to the smallest key
560 * in the current node (if the owner is greater than the
563 if (vm_radix_keybarr(rnode, index)) {
564 if (index > rnode->rn_owner) {
566 KASSERT(++loops < 1000,
567 ("vm_radix_lookup_ge: too many loops"));
570 * Pop nodes from the stack until either the
571 * stack is empty or a node that could have a
572 * matching descendant is found.
577 rnode = stack[--tos];
578 } while (vm_radix_slot(index,
579 rnode->rn_clev) == (VM_RADIX_COUNT - 1));
582 * The following computation cannot overflow
583 * because index's slot at the current level
584 * is less than VM_RADIX_COUNT - 1.
586 index = vm_radix_trimkey(index,
588 index += VM_RADIX_UNITLEVEL(rnode->rn_clev);
590 index = rnode->rn_owner;
591 KASSERT(!vm_radix_keybarr(rnode, index),
592 ("vm_radix_lookup_ge: keybarr failed"));
594 slot = vm_radix_slot(index, rnode->rn_clev);
595 child = vm_radix_node_load(&rnode->rn_child[slot], LOCKED);
596 if (vm_radix_isleaf(child)) {
597 m = vm_radix_topage(child);
598 if (m->pindex >= index)
600 } else if (child != NULL)
604 * Look for an available edge or page within the current
607 if (slot < (VM_RADIX_COUNT - 1)) {
608 inc = VM_RADIX_UNITLEVEL(rnode->rn_clev);
609 index = vm_radix_trimkey(index, rnode->rn_clev);
613 child = vm_radix_node_load(&rnode->rn_child[slot],
615 if (vm_radix_isleaf(child)) {
616 m = vm_radix_topage(child);
617 if (m->pindex >= index)
619 } else if (child != NULL)
621 } while (slot < (VM_RADIX_COUNT - 1));
623 KASSERT(child == NULL || vm_radix_isleaf(child),
624 ("vm_radix_lookup_ge: child is radix node"));
627 * If a page or edge greater than the search slot is not found
628 * in the current node, ascend to the next higher-level node.
632 KASSERT(rnode->rn_clev > 0,
633 ("vm_radix_lookup_ge: pushing leaf's parent"));
634 KASSERT(tos < VM_RADIX_LIMIT,
635 ("vm_radix_lookup_ge: stack overflow"));
636 stack[tos++] = rnode;
642 * Look up the nearest entry at a position less than or equal to index.
645 vm_radix_lookup_le(struct vm_radix *rtree, vm_pindex_t index)
647 struct vm_radix_node *stack[VM_RADIX_LIMIT];
650 struct vm_radix_node *child, *rnode;
656 rnode = vm_radix_root_load(rtree, LOCKED);
659 else if (vm_radix_isleaf(rnode)) {
660 m = vm_radix_topage(rnode);
661 if (m->pindex <= index)
669 * If the keys differ before the current bisection node,
670 * then the search key might rollback to the earliest
671 * available bisection node or to the largest key
672 * in the current node (if the owner is smaller than the
675 if (vm_radix_keybarr(rnode, index)) {
676 if (index > rnode->rn_owner) {
677 index = rnode->rn_owner + VM_RADIX_COUNT *
678 VM_RADIX_UNITLEVEL(rnode->rn_clev);
681 KASSERT(++loops < 1000,
682 ("vm_radix_lookup_le: too many loops"));
685 * Pop nodes from the stack until either the
686 * stack is empty or a node that could have a
687 * matching descendant is found.
692 rnode = stack[--tos];
693 } while (vm_radix_slot(index,
694 rnode->rn_clev) == 0);
697 * The following computation cannot overflow
698 * because index's slot at the current level
701 index = vm_radix_trimkey(index,
705 KASSERT(!vm_radix_keybarr(rnode, index),
706 ("vm_radix_lookup_le: keybarr failed"));
708 slot = vm_radix_slot(index, rnode->rn_clev);
709 child = vm_radix_node_load(&rnode->rn_child[slot], LOCKED);
710 if (vm_radix_isleaf(child)) {
711 m = vm_radix_topage(child);
712 if (m->pindex <= index)
714 } else if (child != NULL)
718 * Look for an available edge or page within the current
722 inc = VM_RADIX_UNITLEVEL(rnode->rn_clev);
727 child = vm_radix_node_load(&rnode->rn_child[slot],
729 if (vm_radix_isleaf(child)) {
730 m = vm_radix_topage(child);
731 if (m->pindex <= index)
733 } else if (child != NULL)
737 KASSERT(child == NULL || vm_radix_isleaf(child),
738 ("vm_radix_lookup_le: child is radix node"));
741 * If a page or edge smaller than the search slot is not found
742 * in the current node, ascend to the next higher-level node.
746 KASSERT(rnode->rn_clev > 0,
747 ("vm_radix_lookup_le: pushing leaf's parent"));
748 KASSERT(tos < VM_RADIX_LIMIT,
749 ("vm_radix_lookup_le: stack overflow"));
750 stack[tos++] = rnode;
756 * Remove the specified index from the trie, and return the value stored at
757 * that index. If the index is not present, return NULL.
760 vm_radix_remove(struct vm_radix *rtree, vm_pindex_t index)
762 struct vm_radix_node *rnode, *parent, *tmp;
766 rnode = vm_radix_root_load(rtree, LOCKED);
767 if (vm_radix_isleaf(rnode)) {
768 m = vm_radix_topage(rnode);
769 if (m->pindex != index)
771 vm_radix_root_store(rtree, NULL, LOCKED);
778 slot = vm_radix_slot(index, rnode->rn_clev);
779 tmp = vm_radix_node_load(&rnode->rn_child[slot], LOCKED);
780 if (vm_radix_isleaf(tmp)) {
781 m = vm_radix_topage(tmp);
782 if (m->pindex != index)
784 vm_radix_node_store(&rnode->rn_child[slot], NULL, LOCKED);
786 if (rnode->rn_count > 1)
788 for (i = 0; i < VM_RADIX_COUNT; i++)
789 if (vm_radix_node_load(&rnode->rn_child[i],
792 KASSERT(i != VM_RADIX_COUNT,
793 ("%s: invalid node configuration", __func__));
794 tmp = vm_radix_node_load(&rnode->rn_child[i], LOCKED);
796 vm_radix_root_store(rtree, tmp, LOCKED);
798 slot = vm_radix_slot(index, parent->rn_clev);
799 KASSERT(vm_radix_node_load(
800 &parent->rn_child[slot], LOCKED) == rnode,
801 ("%s: invalid child value", __func__));
802 vm_radix_node_store(&parent->rn_child[slot],
806 * The child is still valid and we can not zero the
807 * pointer until all smr references are gone.
810 vm_radix_node_put(rnode, i);
819 * Remove and free all the nodes from the radix tree.
820 * This function is recursive but there is a tight control on it as the
821 * maximum depth of the tree is fixed.
824 vm_radix_reclaim_allnodes(struct vm_radix *rtree)
826 struct vm_radix_node *root;
828 root = vm_radix_root_load(rtree, LOCKED);
831 vm_radix_root_store(rtree, NULL, UNSERIALIZED);
832 if (!vm_radix_isleaf(root))
833 vm_radix_reclaim_allnodes_int(root);
837 * Replace an existing page in the trie with another one.
838 * Panics if there is not an old page in the trie at the new page's index.
841 vm_radix_replace(struct vm_radix *rtree, vm_page_t newpage)
843 struct vm_radix_node *rnode, *tmp;
848 index = newpage->pindex;
849 rnode = vm_radix_root_load(rtree, LOCKED);
851 panic("%s: replacing page on an empty trie", __func__);
852 if (vm_radix_isleaf(rnode)) {
853 m = vm_radix_topage(rnode);
854 if (m->pindex != index)
855 panic("%s: original replacing root key not found",
857 rtree->rt_root = (uintptr_t)newpage | VM_RADIX_ISLEAF;
861 slot = vm_radix_slot(index, rnode->rn_clev);
862 tmp = vm_radix_node_load(&rnode->rn_child[slot], LOCKED);
863 if (vm_radix_isleaf(tmp)) {
864 m = vm_radix_topage(tmp);
865 if (m->pindex == index) {
866 vm_radix_node_store(&rnode->rn_child[slot],
867 (struct vm_radix_node *)((uintptr_t)newpage |
868 VM_RADIX_ISLEAF), LOCKED);
872 } else if (tmp == NULL || vm_radix_keybarr(tmp, index))
876 panic("%s: original replacing page not found", __func__);
882 uma_zwait(vm_radix_node_zone);
887 * Show details about the given radix node.
889 DB_SHOW_COMMAND(radixnode, db_show_radixnode)
891 struct vm_radix_node *rnode, *tmp;
896 rnode = (struct vm_radix_node *)addr;
897 db_printf("radixnode %p, owner %jx, children count %u, level %u:\n",
898 (void *)rnode, (uintmax_t)rnode->rn_owner, rnode->rn_count,
900 for (i = 0; i < VM_RADIX_COUNT; i++) {
901 tmp = vm_radix_node_load(&rnode->rn_child[i], UNSERIALIZED);
903 db_printf("slot: %d, val: %p, page: %p, clev: %d\n",
905 vm_radix_isleaf(tmp) ? vm_radix_topage(tmp) : NULL,