From nobody Thu Nov 16 20:54:46 2023 X-Original-To: dev-commits-src-all@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 4SWXN65FSxz5150K; Thu, 16 Nov 2023 20:54:46 +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 4SWXN63qXHz4HL6; Thu, 16 Nov 2023 20:54:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700168086; 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=m+iwurGJpcsMmfftVYr3JD/P7JSe7fj00cJ+l6agr54=; b=jZzh+cdTx+C0X9TTQ33js35NTMWGuv02nXsdP9NVq67gmtwWxNEL1no01savojVx9Rm36D TFGBbytptxC8kADn0uTfwst5HuEZhmNpspGtTvDnQVkQ+vKsZpDaF3XUeDpR6x3/hdpckf LKn0xK2/4JKTLEfUkGk3fG7XmoZO76DFMR92JdwCpK0BtUXq7hlcwUs2ZpZuAj8+siWzrc mCsOV4R3PySg8j03ap+5tnqX5mHzuZTM0FybeIslV22qHguEFEj1CAu4lDnsSLzyVWw9NR xXN84UE4TAfXmBup5ITuayiRCZsr/flsqhWDLmnjuIL7O/5OcWUjdkd0OUJwxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700168086; 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=m+iwurGJpcsMmfftVYr3JD/P7JSe7fj00cJ+l6agr54=; b=PwkFTM8/pdauIqf6FI6c/1GEIc9EtZKxniaKl/8xDT6hGtJE29SUITU8PXUz8IFIqBXPXL /t6tOwmMZgVOycq2zq7K230+uiTpjt7F/3js6ZdUN7sZcuguXC1FfIZI0HfDn1XvAOzS5E lBdzSu6jWB9bhYT1jDbYuanBnOSwTPWv85hJc8SRUEMaWXiHHuuo2S/JFokv79XoXsQgs+ mU6s2BYbbPky2Khpg5oNEF5g/6b3NZi9zU0LtNum3Rabmj4rxJeODpsAGT3O0oF30qSL4M B0wYlMm7L6dBXXJ3CgNN9mw1sOfEJel1myet+NGoZb+GlDzGI0jTX+XPqiSLFw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1700168086; a=rsa-sha256; cv=none; b=MuVE3rghP8OSgPouVu9wgm5zGI2Gr0EwD7OXmOMz4ChraSDjQvOOjRtrXgCyHkH/stwdNd OHLZ+so68eFTsq1rSgBL4PaNzG10JFYNzvgtwMAaHCCd477JB0GBe9IomZWuztlX/ajOI0 9o/1tzIosnttSkUDgFQnFh9UrQJhBrlTxGACcg2vd9HzYvkuDmeQF5ymKJoC+qXt76bGM9 G00yM69U/U89g3yUFi8mog0yOUlaP6kYL28nfxMKOTzgBCTW4EECei/VnNBvKRuNAbfzod RsBG7P8tv4UYEUSf7I8BFn2y1Bws7Dp5YUouebzJ50BGV2Aplr2VwelEaxh/yQ== 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 4SWXN62jCqz1Wt; Thu, 16 Nov 2023 20:54:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3AGKskKO053952; Thu, 16 Nov 2023 20:54:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3AGKsk8I053949; Thu, 16 Nov 2023 20:54:46 GMT (envelope-from git) Date: Thu, 16 Nov 2023 20:54:46 GMT Message-Id: <202311162054.3AGKsk8I053949@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 25e0e25afd29 - stable/14 - uma: Permit specifying max of cache line and some custom alignment List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 25e0e25afd29d029da6ec21e6b7890310ffc25bd Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=25e0e25afd29d029da6ec21e6b7890310ffc25bd commit 25e0e25afd29d029da6ec21e6b7890310ffc25bd Author: Olivier Certner AuthorDate: 2023-10-13 15:05:34 +0000 Commit: Mark Johnston CommitDate: 2023-11-16 15:07:18 +0000 uma: Permit specifying max of cache line and some custom alignment To be used for structures for which we want to enforce that pointers to them have some number of lower bits always set to 0, while still ensuring we benefit from cache line alignment to avoid false sharing between structures and fields within the structures (provided they are properly ordered). First candidate consumer that comes to mind is 'struct thread', see next commit. Reviewed by: markj, kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D42265 (cherry picked from commit 733e0abd2897289e2acf70f7c72e31a5a560394a) --- sys/vm/uma.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/vm/uma.h b/sys/vm/uma.h index 8193df16b904..38865df7ae02 100644 --- a/sys/vm/uma.h +++ b/sys/vm/uma.h @@ -302,6 +302,8 @@ uma_zone_t uma_zcache_create(const char *name, int size, uma_ctor ctor, #define UMA_ALIGN_SHORT (sizeof(short) - 1) /* "" short */ #define UMA_ALIGN_CHAR (sizeof(char) - 1) /* "" char */ #define UMA_ALIGN_CACHE (uma_get_cache_align_mask()) /* Cache line size align */ +/* Align both to cache line size and an explicit alignment (through mask). */ +#define UMA_ALIGN_CACHE_AND_MASK(mask) (uma_get_cache_align_mask() | (mask)) #define UMA_ALIGNOF(type) (_Alignof(type) - 1) /* Alignment fit for 'type' */ #define UMA_ANYDOMAIN -1 /* Special value for domain search. */