Index: sys/vm/vm_radix.c =================================================================== --- sys/vm/vm_radix.c (revision 235232) +++ sys/vm/vm_radix.c (working copy) @@ -305,6 +305,8 @@ c = (uintptr_t)child; + CTR3(KTR_FLO, "match: child %p, color %d, ret %jx", + child, color, (uintmax_t)(c & ~VM_RADIX_FLAGS)); if ((c & color) == 0) return (NULL); return ((void *)(c & ~VM_RADIX_FLAGS)); @@ -534,6 +536,9 @@ return (void *)child; } +#define INT64L(x) ((x) & 0xFFFFFFFF) +#define INT64H(x) ((x) << 32) + /* * Find the first leaf with a valid node between *startp and end. Return * the index of the first valid item in the leaf in *startp. @@ -548,10 +553,18 @@ int level; start = *startp; + CTR5(KTR_FLO, "leaf: tree %p, startl %lx, starth %lx, endl %lx, endh %lx", + rtree, INT64L(*startp), INT64H(*startp), INT64L(end), INT64H(end)); restart: level = vm_radix_height(rtree, &rnode); + CTR6(KTR_FLO, + "leaf: tree %p, startl %lx, starth %lx, endl %lx, endh %lx, level %d", + rtree, INT64L(*startp), INT64H(*startp), INT64L(end), INT64H(end), level); if (start > VM_RADIX_MAX(level) || (end && start >= end)) { rnode = NULL; + CTR5(KTR_FLO, + "leaf: exit startl %lx, starth %lx, endl %lx, endh %lx, level %d", + INT64L(start), INT64H(start), INT64L(end), INT64H(end), level); goto out; } /* @@ -560,12 +573,15 @@ */ for (level--; level; level--) { slot = vm_radix_slot(start, level); - CTR6(KTR_VM, - "leaf: tree %p, index %ju, level %d, slot %d, rnode %p, child %p", - rtree, (uintmax_t)start, level, slot, rnode, - (rnode != NULL) ? rnode->rn_child[slot] : NULL); + CTR6(KTR_FLO, + "leaf: tree %p, indexl %lx, indexh %lx, level %d, slot %d, rnode %p", + rtree, INT64L(start), INT64H(start), level, slot, rnode); if (rnode->rn_child[slot] != NULL) { rnode = rnode->rn_child[slot]; + CTR6(KTR_FLO, + "leaf: continuing startl %lx, starth %lx, endl %lx, endh %lx, slot %d, rnode %p", + INT64L(start), INT64H(start), INT64L(end), INT64H(end), + slot, rnode); continue; } /* @@ -580,30 +596,50 @@ /* Avoid start address wrapping up. */ if ((VM_RADIX_MAXVAL - start) < inc) { rnode = NULL; + CTR5(KTR_FLO, + "leaf: exit startl %lx, starth %lx, endl %lx, endh %lx, slot %d", + INT64L(start), INT64H(start), INT64L(end), INT64H(end), slot); goto out; } start += inc; slot++; - CTR5(KTR_VM, - "leaf: start %ju end %ju inc %ju mask 0x%jX slot %d", - (uintmax_t)start, (uintmax_t)end, (uintmax_t)inc, - (uintmax_t)~VM_RADIX_MAX(level), slot); + CTR4(KTR_FLO, "leaf: startl %lx, starth %lx, endl %lx, endh %lx", + INT64L(start), INT64H(start), INT64L(end), INT64H(end)); + CTR4(KTR_FLO, "leaf: incl %lx, inch %lx, mask 0x%jX slot %d", + INT64L(inc), INT64H(inc), ~VM_RADIX_MAX(level), slot); for (; slot < VM_RADIX_COUNT; slot++, start += inc) { if (end != 0 && start >= end) { rnode = NULL; + CTR5(KTR_FLO, + "leaf: exit startl %lx, starth %lx, endl %lx, endh %lx, slot %d", + INT64L(start), INT64H(start), INT64L(end), + INT64H(end), slot); goto out; } if (rnode->rn_child[slot]) { rnode = rnode->rn_child[slot]; + CTR6(KTR_FLO, + "leaf: exit startl %lx, starth %lx, endl %lx, endh %lx, slot %d, rnode %p", + INT64L(start), INT64H(start), INT64L(end), + INT64H(end), slot, rnode); break; } if ((VM_RADIX_MAXVAL - start) < inc) { rnode = NULL; + CTR6(KTR_FLO, + "leaf: exit startl %lx, starth %lx, endl %lx, endh %lx, slot %d, rnode %p", + INT64L(start), INT64H(start), INT64L(end), + INT64H(end), slot, rnode); goto out; } } - if (slot == VM_RADIX_COUNT) + if (slot == VM_RADIX_COUNT) { + CTR6(KTR_FLO, + "leaf: exit startl %lx, starth %lx, endl %lx, endh %lx, slot %d, level %d", + INT64L(start), INT64H(start), INT64L(end), INT64H(end), + slot, level); goto restart; + } } out: @@ -627,28 +663,52 @@ int slot; int outidx; - CTR3(KTR_VM, "lookupn: tree %p, start %ju, end %ju", - rtree, (uintmax_t)start, (uintmax_t)end); - if (rtree->rt_root == 0) + CTR5(KTR_FLO, "lookupn: tree %p, startl %lx, starth %lx, endl %lx, endh %lx", + rtree, INT64L(start), INT64H(start), INT64L(end), INT64H(end)); + if (rtree->rt_root == 0) { + CTR0(KTR_FLO, "lookupn: return with rt_root 0"); return (0); + } outidx = 0; while ((rnode = vm_radix_leaf(rtree, &start, end)) != NULL) { slot = vm_radix_slot(start, 0); + CTR2(KTR_FLO, "lookupn: rnode %p with slot %d found on leaf", + rnode, slot); for (; slot < VM_RADIX_COUNT; slot++, start++) { - if (end != 0 && start >= end) + if (end != 0 && start >= end) { + CTR5(KTR_FLO, + "lookupn: exit startl %lx, starth %lx, endl %lx, endh %lx, slot %d", + INT64L(start), INT64H(start), INT64L(end), + INT64H(end), slot); goto out; + } val = vm_radix_match(rnode->rn_child[slot], color); - if (val == NULL) + if (val == NULL) { + CTR5(KTR_FLO, + "lookupn: continuing startl %lx, starth %lx, endl %lx, endh %lx, slot %d", + INT64L(start), INT64H(start), INT64L(end), + INT64H(end), slot); continue; - CTR4(KTR_VM, - "lookupn: tree %p index %ju slot %d found child %p", - rtree, (uintmax_t)start, slot, val); + } + CTR5(KTR_FLO, + "lookupn: tree %p indexl %lx, indexh %lx, slot %d found child %p", + rtree, INT64L(start), INT64H(start), slot, val); out[outidx] = val; - if (++outidx == cnt) + if (++outidx == cnt) { + CTR6(KTR_FLO, + "lookupn: exit startl %lx, starth %lx, endl %lx, endh %lx, slot %d, outidx %d", + INT64L(start), INT64H(start), INT64L(end), + INT64H(end), slot, outidx); goto out; + } } - if (end != 0 && start >= end) + if (end != 0 && start >= end) { + CTR6(KTR_FLO, + "lookupn: exit startl %lx, starth %lx, endl %lx, endh %lx, slot %d, outidx %d", + INT64L(start), INT64H(start), INT64L(end), INT64H(end), + slot, outidx); break; + } } out: *next = start; Index: sys/sys/ktr.h =================================================================== --- sys/sys/ktr.h (revision 235232) +++ sys/sys/ktr.h (working copy) @@ -75,6 +75,7 @@ #define KTR_INET6 0x10000000 /* IPv6 stack */ #define KTR_SCHED 0x20000000 /* Machine parsed sched info. */ #define KTR_BUF 0x40000000 /* Buffer cache */ +#define KTR_FLO 0x80000000 /* Test */ #define KTR_ALL 0x7fffffff /* Trace classes to compile in */