Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Jul 2017 16:40:14 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r321625 - in head/sys: kern sys
Message-ID:  <201707271640.v6RGeEgq069693@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Thu Jul 27 16:40:14 2017
New Revision: 321625
URL: https://svnweb.freebsd.org/changeset/base/321625

Log:
  Make the number of children for pctrie node available outside subr_pctrie.c.
  
  Reviewed by:	alc, markj
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week
  X-Differential revision:	https://reviews.freebsd.org/D11435

Modified:
  head/sys/kern/subr_pctrie.c
  head/sys/sys/pctrie.h

Modified: head/sys/kern/subr_pctrie.c
==============================================================================
--- head/sys/kern/subr_pctrie.c	Thu Jul 27 15:59:36 2017	(r321624)
+++ head/sys/kern/subr_pctrie.c	Thu Jul 27 16:40:14 2017	(r321625)
@@ -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)
 

Modified: head/sys/sys/pctrie.h
==============================================================================
--- head/sys/sys/pctrie.h	Thu Jul 27 15:59:36 2017	(r321624)
+++ head/sys/sys/pctrie.h	Thu Jul 27 16:40:14 2017	(r321625)
@@ -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_ */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201707271640.v6RGeEgq069693>