From owner-svn-src-all@freebsd.org Tue Feb 4 20:28:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 521C6233332; Tue, 4 Feb 2020 20:28:07 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Bx8l1QtKz4W1n; Tue, 4 Feb 2020 20:28:07 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C42B1F69E; Tue, 4 Feb 2020 20:28:07 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014KS76b088836; Tue, 4 Feb 2020 20:28:07 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014KS7TX088835; Tue, 4 Feb 2020 20:28:07 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <202002042028.014KS7TX088835@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Tue, 4 Feb 2020 20:28:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357527 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 357527 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 20:28:07 -0000 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 },