From nobody Wed Apr 26 14:14:01 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q617s2PW6z46Z0j; Wed, 26 Apr 2023 14:14:01 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q617s1wxsz4Mhp; Wed, 26 Apr 2023 14:14:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682518441; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dpOArAS3L0I1R3PhqbkOKHJjosI2h3Hiv7k4XGhG9Vs=; b=wvmAy/k+ZCCefTC5xlNp0dMl1mafnfLzuke/5iIRaD8TS4qMiBX5PoVaFRr8m+X+wbetzi 4nyD0GWb3AmROYtLRMN1Rlnn+5X+Rop/1vDPt6gB+oqW8mkFG3n7hpr17ULQeKAHNyL6nK sKcwCZxBKDNSfY9aaxVC2LjjcMiyDVQjLqR+esvdka0gxlGuEIVDH/Pe1JzyWt/4GK09WQ tQFnzSw4YNc5FNXJD/vaB8rPOg15c8OVdknvr4WuXLGh5WXZ6j+SuuYBX+tfTkzfgvkfm7 FARXmtl9+c5YpO0eNuxxRLlvybah/2neeJq1AubtK9V60E/XArsdPVMnIRRsgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682518441; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dpOArAS3L0I1R3PhqbkOKHJjosI2h3Hiv7k4XGhG9Vs=; b=jMGN7sx9/EvMH6wZ6M7vufL6hCoQPwRtEbjIEQQV1zn+EgkA0NmOUwlDfc7DJm03qwLlfO KL5Ke36EMZKTP3HrzHQXoN1KjurKQZ6wvLv74TIIxLbmqwkpWBxc2XOGd5Ks5GlIG/aqOK IRhsm367JPEIMbJR/I99OBfSjE1ppwjlZq7ttPxzS1/ObO2S7fndpuhczA8zUS3pYZbJ5g dU8l5N3ncK55sTuKsKinkVyssqelYL/cVSBNfxrjge3ZOtZj7crb7xY9jAW4/LvbjKU6Wm h+fzLtYpz0KO7fB1oA4bf0Yq2N11j1vEVL+LgQIrQELONNNWjZ2OMXT4tCUnog== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682518441; a=rsa-sha256; cv=none; b=kmL+MkI7e5mnB0dj3rjo8kCjQLuAWh/B43wTQ7+o/uzBM5qby7MDC1IV6rTbsa/+yWl0NJ WzMqY3QAyGaQqCxC9okMvP9U+TMiy66WVciOH0QlDG9jYooY7mGaD0Qbubi4ALpiZhXzcq ptof3/h2+NiWrExcJzZ/BzSIBK2Bla2FRkG0wwU5oiZgnC2vVZkXwRbgaqVC8qwsdenrLx BD7iOg/nY14LHVgjiVbCLifevqfQakVTyDPwcXv7HmoML6YILx3bQxyIBmqLg1i9+Jp6Us Y5Z46GJeuAabuBcLu9A27GsgaABJDlrR5ann9YBmaPfaZpxh6MPhlatVX5bqwQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q617s12Glzd3V; Wed, 26 Apr 2023 14:14:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 33QEE1Lj086693; Wed, 26 Apr 2023 14:14:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33QEE1Qd086692; Wed, 26 Apr 2023 14:14:01 GMT (envelope-from git) Date: Wed, 26 Apr 2023 14:14:01 GMT Message-Id: <202304261414.33QEE1Qd086692@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: e72f7ed43eef - main - buf: Dynamically allocate per-CPU buffer queues List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e72f7ed43eefaf305c33c232bc2c33d997427f58 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e72f7ed43eefaf305c33c232bc2c33d997427f58 commit e72f7ed43eefaf305c33c232bc2c33d997427f58 Author: Mark Johnston AuthorDate: 2023-04-26 14:09:31 +0000 Commit: Mark Johnston CommitDate: 2023-04-26 14:09:31 +0000 buf: Dynamically allocate per-CPU buffer queues To reduce static bloat. No functional change intended. PR: 269572 Reviewed by: mjg, kib, emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39808 --- sys/kern/vfs_bio.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index f1089964a041..6ba7054d3866 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -118,7 +118,7 @@ struct bufqueue { #define BQ_ASSERT_LOCKED(bq) mtx_assert(BQ_LOCKPTR((bq)), MA_OWNED) struct bufdomain { - struct bufqueue bd_subq[MAXCPU + 1]; /* Per-cpu sub queues + global */ + struct bufqueue *bd_subq; struct bufqueue bd_dirtyq; struct bufqueue *bd_cleanq; struct mtx_padalign bd_run_lock; @@ -1914,6 +1914,9 @@ bd_init(struct bufdomain *bd) { int i; + /* Per-CPU clean buf queues, plus one global queue. */ + bd->bd_subq = mallocarray(mp_maxid + 2, sizeof(struct bufqueue), + M_BIOBUF, M_WAITOK | M_ZERO); bd->bd_cleanq = &bd->bd_subq[mp_maxid + 1]; bq_init(bd->bd_cleanq, QUEUE_CLEAN, mp_maxid + 1, "bufq clean lock"); bq_init(&bd->bd_dirtyq, QUEUE_DIRTY, -1, "bufq dirty lock");