diff options
author | kib <kib@FreeBSD.org> | 2017-08-03 07:28:54 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2017-08-03 07:28:54 +0000 |
commit | e2e84a25a976cfd8cb2558e17386d2fa77887aca (patch) | |
tree | 94af79cbcf59e521b40425f9dafd65657d545599 | |
parent | 5a265722601e6b5e97f6db0047fa23c6b8882d8d (diff) | |
download | FreeBSD-src-e2e84a25a976cfd8cb2558e17386d2fa77887aca.zip FreeBSD-src-e2e84a25a976cfd8cb2558e17386d2fa77887aca.tar.gz |
MFC r321625:
Make the number of children for pctrie node available outside subr_pctrie.c.
-rw-r--r-- | sys/kern/subr_pctrie.c | 12 | ||||
-rw-r--r-- | sys/sys/pctrie.h | 13 |
2 files changed, 13 insertions, 12 deletions
diff --git a/sys/kern/subr_pctrie.c b/sys/kern/subr_pctrie.c index b538f5d..e92d26c 100644 --- a/sys/kern/subr_pctrie.c +++ b/sys/kern/subr_pctrie.c @@ -58,18 +58,6 @@ __FBSDID("$FreeBSD$"); #include <ddb/ddb.h> #endif -/* - * These widths should allow the pointers to a node's children to fit within - * a single cache line. The extra levels from a narrow width should not be - * a problem thanks to path compression. - */ -#ifdef __LP64__ -#define PCTRIE_WIDTH 4 -#else -#define PCTRIE_WIDTH 3 -#endif - -#define PCTRIE_COUNT (1 << PCTRIE_WIDTH) #define PCTRIE_MASK (PCTRIE_COUNT - 1) #define PCTRIE_LIMIT (howmany(sizeof(uint64_t) * NBBY, PCTRIE_WIDTH) - 1) diff --git a/sys/sys/pctrie.h b/sys/sys/pctrie.h index 56c1b8c..1fd0b34 100644 --- a/sys/sys/pctrie.h +++ b/sys/sys/pctrie.h @@ -133,5 +133,18 @@ pctrie_is_empty(struct pctrie *ptree) return (ptree->pt_root == 0); } +/* + * These widths should allow the pointers to a node's children to fit within + * a single cache line. The extra levels from a narrow width should not be + * a problem thanks to path compression. + */ +#ifdef __LP64__ +#define PCTRIE_WIDTH 4 +#else +#define PCTRIE_WIDTH 3 +#endif + +#define PCTRIE_COUNT (1 << PCTRIE_WIDTH) + #endif /* _KERNEL */ #endif /* !_SYS_PCTRIE_H_ */ |