From nobody Thu Dec 21 13:44:00 2023 X-Original-To: dev-commits-src-branches@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 4Sws8x3n51z54pxN; Thu, 21 Dec 2023 13:44: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 4Sws8x1TYzz4PTJ; Thu, 21 Dec 2023 13:44:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166241; 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=PeqkXWl+yb2sOfByBZq/+7WvxobYQyaIcxhaFsm9Ys0=; b=jMa3UzEdbn2SQMtQVZlpptjtgTsgeTadjK+7atw5ZQPOucJdTt3XKWwZA9sDHtS3vR1IO+ re/b9VSuYAKIsb6iEnoHoO1GrkhNcsp2EE/3p00dMYK8erYeb4bPJOpiXA6cPalkblQ/3x Zto3U5xivSTXEQY1Mt2Vu+6NydYQtRoq+fRWBbhexIkWJKHLHbR/v2WJlEAobM+ZUnOSsf VG1lsNTK7B6l7ylIhNWYJ4I8Q3TT1YSQvGOs+coNiSB65U1lO89Cb18DmpVT17DiuxoNW9 Y9UCXJlAIgTdGT224lxPJzB8IS4VCgIieQ/O8wUnKyYSwYQ7G2O/qCynDMEmOQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703166241; a=rsa-sha256; cv=none; b=HPpPGDqLtV/7bB0k3qm9c6cW8J1YgMlxsHXzt9K01fMyYAW3d8kCX4hBgMniC5LFVKvTMD jdTjMjKC0js3DDD40SxtCimVXSi6OrRUFfIYkJkCYzi8b4M6bUwY7hmz1Ju7cA0HOqrbJm iSUgzbrBbGBgvzV556VZYKfma+XOrJFvpcFSO++yUSqCJEwuRaCn3ei/NV7GhKadW2WV5k RBkxoj2Qj3hPSUMiOQFVaagy1QWa1giAw7h3KVjFgA8q0YYycswdzrRoSmU+Q7fQ0MGZUH 63/tgQT3A4yBk/OZc/T1ykS5shBYvgg8aGhV91HDktr/GlYawanKr1HBabXrEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166241; 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=PeqkXWl+yb2sOfByBZq/+7WvxobYQyaIcxhaFsm9Ys0=; b=ieJFZykpBdzSR5epGfTP+iijCwXQqfXh0Vwc5cgyy0I84zZNmkhmrqWPxQ/KHaExSQ/u3z A11bIHCKaUOO4Yo4wPeO87nL175lK1+MtQkc+HspNQvjqRuDkNwoOcKrebEFnMvsDETULa dUsW1T3wZ6B7I6+fNUH4+n9QeKOCuU/Ws/WEbYqxLyum84s+dalqUYWzAi15KrSR3yEOnW R8fjLDT/9ak9hcu4NtoEO2kOfJgj+pDdgSYq1sS821c9stUe3cIYfGvIosxPoY8mnyn/ft 65XqmujiXajtX1/1L+NhLX/9E8vzK3IjmDQZcLBAIFQkfcJNKEwsgejnX+bbbw== 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 4Sws8x0Ylgzb4M; Thu, 21 Dec 2023 13:44:01 +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 3BLDi0HS080189; Thu, 21 Dec 2023 13:44:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLDi0M9080186; Thu, 21 Dec 2023 13:44:00 GMT (envelope-from git) Date: Thu, 21 Dec 2023 13:44:00 GMT Message-Id: <202312211344.3BLDi0M9080186@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 6e4b7753610d - stable/13 - uma: Permit specifying max of cache line and some custom alignment List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6e4b7753610d2594740d73120fe6251ce7f66a61 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=6e4b7753610d2594740d73120fe6251ce7f66a61 commit 6e4b7753610d2594740d73120fe6251ce7f66a61 Author: Olivier Certner AuthorDate: 2023-10-13 15:05:34 +0000 Commit: Olivier Certner CommitDate: 2023-12-21 13:40:09 +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 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D42265 (cherry picked from commit 733e0abd2897289e2acf70f7c72e31a5a560394a) Approved by: markj (mentor) --- sys/vm/uma.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/vm/uma.h b/sys/vm/uma.h index 852473d69c27..2a305d87ca34 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. */