From nobody Wed Apr 26 14:13:59 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 4Q617r2GQmz46ZKT; Wed, 26 Apr 2023 14:14:00 +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 4Q617r1LTjz4McG; Wed, 26 Apr 2023 14:14:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682518440; 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=sASe+oRrJ1k3tllUoPCvOrc829SWZt7EZKqxVYA3vGo=; b=vc4rHWohsoq4u+Z/GJUdx8t87ohfI+cv/u8UvzznJvfEF5/PeVEtGc3kuTLh9ezHvuHLXF 3ew3rKBj5k8l41dMFqUl+W/Rbhry+iKgGJwvVvzLlNnfbD0F0x3wydx9xBxvdV0ieaF4UE Cy4mA1UJ+e67piM+utPvbt/2++NeJx+kE704RRBEfy978o0IPuDh96qtSkh0P7+RHgIFRF JlvroeLSQzDZWUn8K5XMingbFmv78q9mAtHXvhR6kV0bTd9lb6I9N3VfSHxjm6LoQXWdGw bvjVnpw44iG1JmYCQqptGdezLXqGIwgr9vfxseuUEMG2XdPSdAcDXwJl6AWaCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682518440; 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=sASe+oRrJ1k3tllUoPCvOrc829SWZt7EZKqxVYA3vGo=; b=pEdmxSEViNCoSnYNPv5q3TYB7dImCuBEFUzLOrn7w2GjDwTXCjydN41OBgLUck3VxRuFCH 7BHUeAEOtcvzvFaeqtuHuT3zGRTN0OsYJu/vD0SVIi52Y1vPQ7FPmP3ZW1UitdW/zJ4tiq xqcfMOUpkSj5x2w3Q/cAF9x3BEtEbln+ySA5cOmmXNHh8JTRIpjrPFz1fFBZGRC5Zl/LnN I6piU4YQ6r2JkhQ0hk+UgyN65Egj0eOZo4QNlzi4hjQ6LVMCF1RANRbZZPIa8AZg7HOMAU KQMYCXcAU4Jou/GYTdksUs7xzv4QOiuh6FfNP1YbGfj8dHjM36ZYJ4SOa7eY0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682518440; a=rsa-sha256; cv=none; b=uGbl9k1O8G76xX9mX7IS12Frckq9gX4ehxJUgK/3pYd+qXOvvKeE2oqneLnuKniagdUWPg CeZF2qxDDUfiSZx1+CDflmwn5JOB178gBMLxLpc4rulE5uvsYcqJKnOs3frBBZzngwKk2M z+iHg3x4frT++RdBStOGwdnDvtFKPilWdhhbFC7hvYIr8rygbqoC7l7z+BnKIwPeXMMuN/ R/vwZ5CfI1rmGwliLQFpS6CMFjD+Mmyp9O22fmoCGdIc+U1+mytcSa2tN2G1m4jwOf+N3O 0z7xutg92whWfGreilk6/z8bG+edlHLKl+i1VC4e/QFBDn3uNRjErYimdzomVg== 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 4Q617r0P6gzdPX; Wed, 26 Apr 2023 14:14:00 +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 33QEDxlx086667; Wed, 26 Apr 2023 14:13:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33QEDxBD086666; Wed, 26 Apr 2023 14:13:59 GMT (envelope-from git) Date: Wed, 26 Apr 2023 14:13:59 GMT Message-Id: <202304261413.33QEDxBD086666@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: 78cfa762ebf2 - main - callout: Move per-CPU callout state into the dpcpu region 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: 78cfa762ebf2afc821e49e41c7bc72cc9044c233 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=78cfa762ebf2afc821e49e41c7bc72cc9044c233 commit 78cfa762ebf2afc821e49e41c7bc72cc9044c233 Author: Mark Johnston AuthorDate: 2023-04-26 14:09:09 +0000 Commit: Mark Johnston CommitDate: 2023-04-26 14:09:09 +0000 callout: Move per-CPU callout state into the dpcpu region This eliminates some static bloat in amd64 kernels and reduces the penalty of increasing MAXCPU. The structures now also maintain NUMA affinity. No functional change intended. PR: 269572 Reviewed by: mjg, kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39807 --- sys/kern/kern_timeout.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c index 05497f3d46d7..374e8f2b172a 100644 --- a/sys/kern/kern_timeout.c +++ b/sys/kern/kern_timeout.c @@ -195,9 +195,9 @@ struct callout_cpu { #define cc_migration_time(cc, dir) cc->cc_exec_entity[dir].ce_migration_time #define cc_migration_prec(cc, dir) cc->cc_exec_entity[dir].ce_migration_prec -static struct callout_cpu cc_cpu[MAXCPU]; +DPCPU_DEFINE_STATIC(struct callout_cpu, cc_cpu); #define CPUBLOCK MAXCPU -#define CC_CPU(cpu) (&cc_cpu[(cpu)]) +#define CC_CPU(cpu) DPCPU_ID_PTR(cpu, cc_cpu) #define CC_SELF() CC_CPU(PCPU_GET(cpuid)) #else static struct callout_cpu cc_cpu; @@ -321,7 +321,7 @@ callout_cpu_init(struct callout_cpu *cc, int cpu) { int i; - mtx_init(&cc->cc_lock, "callout", NULL, MTX_SPIN); + mtx_init(&cc->cc_lock, "callout", NULL, MTX_SPIN | MTX_NEW); cc->cc_callwheel = malloc_domainset(sizeof(struct callout_list) * callwheelsize, M_CALLOUT, DOMAINSET_PREF(pcpu_find(cpu)->pc_domain), M_WAITOK);