Module Name: src Committed By: ad Date: Tue Jan 28 22:20:45 UTC 2020
Modified Files: src/common/lib/libc/gen: radixtree.c Log Message: gang_lookup_scan(): if a dense scan and the first sibling doesn't match, the scan is finished. To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/common/lib/libc/gen/radixtree.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/common/lib/libc/gen/radixtree.c diff -u src/common/lib/libc/gen/radixtree.c:1.22 src/common/lib/libc/gen/radixtree.c:1.23 --- src/common/lib/libc/gen/radixtree.c:1.22 Tue Jan 28 16:33:34 2020 +++ src/common/lib/libc/gen/radixtree.c Tue Jan 28 22:20:45 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: radixtree.c,v 1.22 2020/01/28 16:33:34 ad Exp $ */ +/* $NetBSD: radixtree.c,v 1.23 2020/01/28 22:20:45 ad Exp $ */ /*- * Copyright (c)2011,2012,2013 YAMAMOTO Takashi, @@ -112,7 +112,7 @@ #include <sys/cdefs.h> #if defined(_KERNEL) || defined(_STANDALONE) -__KERNEL_RCSID(0, "$NetBSD: radixtree.c,v 1.22 2020/01/28 16:33:34 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: radixtree.c,v 1.23 2020/01/28 22:20:45 ad Exp $"); #include <sys/param.h> #include <sys/errno.h> #include <sys/pool.h> @@ -122,7 +122,7 @@ __KERNEL_RCSID(0, "$NetBSD: radixtree.c, #include <lib/libsa/stand.h> #endif /* defined(_STANDALONE) */ #else /* defined(_KERNEL) || defined(_STANDALONE) */ -__RCSID("$NetBSD: radixtree.c,v 1.22 2020/01/28 16:33:34 ad Exp $"); +__RCSID("$NetBSD: radixtree.c,v 1.23 2020/01/28 22:20:45 ad Exp $"); #include <assert.h> #include <errno.h> #include <stdbool.h> @@ -843,34 +843,16 @@ scan_siblings: break; } n = path_node(t, path, lastidx - 1); - /* - * we used to have an integer counter in the node, and this - * optimization made sense then, even though marginal. it - * no longer provides benefit with the structure cache line - * aligned and the counter replaced by an unrolled sequence - * testing the pointers in batch. - */ -#if 0 - if (*vpp != NULL && radix_tree_node_count_ptrs(n) == 1) { - /* - * optimization; if the node has only a single pointer - * and we've already visited it, there's no point to - * keep scanning in this node. - */ - goto no_siblings; - } -#endif /* 0 */ for (i = vpp - n->n_ptrs + step; i != guard; i += step) { KASSERT(i < RADIX_TREE_PTR_PER_NODE); if (entry_match_p(n->n_ptrs[i], tagmask)) { vpp = &n->n_ptrs[i]; break; + } else if (dense) { + return nfound; } } if (i == guard) { -#if 0 -no_siblings: -#endif /* 0 */ /* * not found. go to parent. */