Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Feb 2020 20:28:07 +0000 (UTC)
From:      Jeff Roberson <jeff@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r357527 - head/sys/vm
Message-ID:  <202002042028.014KS7TX088835@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jeff
Date: Tue Feb  4 20:28:06 2020
New Revision: 357527
URL: https://svnweb.freebsd.org/changeset/base/357527

Log:
  Use literal bucket sizes for smaller buckets rather than the rounding
  system.  Small bucket sizes already pack well even if they are an odd
  number of words.  This prevents any potential new instances of the
  problem fixed in r357463 as well as making the system easier to
  understand.
  
  Reviewed by:	markj
  Differential Revision:	https://reviews.freebsd.org/D23494

Modified:
  head/sys/vm/uma_core.c

Modified: head/sys/vm/uma_core.c
==============================================================================
--- head/sys/vm/uma_core.c	Tue Feb  4 20:09:25 2020	(r357526)
+++ head/sys/vm/uma_core.c	Tue Feb  4 20:28:06 2020	(r357527)
@@ -236,16 +236,15 @@ struct uma_bucket_zone {
     (((sizeof(void *) * (n)) - sizeof(struct uma_bucket)) / sizeof(void *))
 
 #define	BUCKET_MAX	BUCKET_SIZE(256)
-#define	BUCKET_MIN	BUCKET_SIZE(4)
+#define	BUCKET_MIN	2
 
 struct uma_bucket_zone bucket_zones[] = {
-#ifndef __ILP32__
-	{ NULL, "4 Bucket", BUCKET_SIZE(4), 4096 },
-#endif
-	{ NULL, "6 Bucket", BUCKET_SIZE(6), 3072 },
-	{ NULL, "8 Bucket", BUCKET_SIZE(8), 2048 },
-	{ NULL, "12 Bucket", BUCKET_SIZE(12), 1536 },
-	{ NULL, "16 Bucket", BUCKET_SIZE(16), 1024 },
+	/* Literal bucket sizes. */
+	{ NULL, "2 Bucket", 2, 4096 },
+	{ NULL, "4 Bucket", 4, 3072 },
+	{ NULL, "8 Bucket", 8, 2048 },
+	{ NULL, "16 Bucket", 16, 1024 },
+	/* Rounded down power of 2 sizes for efficiency. */
 	{ NULL, "32 Bucket", BUCKET_SIZE(32), 512 },
 	{ NULL, "64 Bucket", BUCKET_SIZE(64), 256 },
 	{ NULL, "128 Bucket", BUCKET_SIZE(128), 128 },



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