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 },
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to