From nobody Thu Nov 16 20:54:40 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 4SWXN109mNz5155Q; Thu, 16 Nov 2023 20:54:41 +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 4SWXN064Cgz4Ghs; Thu, 16 Nov 2023 20:54:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700168080; 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=6fZRV5PDWZD4jNvCtMuvu+b2E6mo+CnkckhxktXNeEQ=; b=cWrWqonstbZMpNmLv4CxFuTSucxQAlSXsgVT7q+5OnEzgEBLhLG0nEvbcEan0egGIMoFhL P9UBO3tX8geypBC6erzHayJgs9KxlRn2bvjCY6urCYJTzfHITm3BZPETv8VXV2TKt4qsrY oluYK9C5/yBbOZFkNLE1uDgWDhxXehQ5h0E4w681lV4RkzyVQfpJw7iwng4Gqe5FQjR2h0 AZInzuf8LETTLif1rB5kfuGOYwr7dSRy2RryYPq9n9AF/xUrFUjrzdYIv7RHIrLXa+zFty v5g1sPqTNwRUHIe5W9QW3N+UrE0d/JN1lxRfHavnntQm3GhL9vE9ezG+juHXdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700168080; 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=6fZRV5PDWZD4jNvCtMuvu+b2E6mo+CnkckhxktXNeEQ=; b=AaB54JVDfrNUUGnCngkCcjPytSwz3tp95flNB1kEkGazb401Y8Jx4mSukvIN2pw35ntl2F Fky6RwVlzzGI5fSHPh251nFGnopcq9VnxIUBC9V2S7ByeQG/saaZt6xgVdIuiIGJyQAvpP eSYh1ExYJz5NrYqJg2XrUa8jo14fq/rolqaQ5WDGjiDLnnEqddniMNDH7OG0fA9EOCHwTY iwW/KhN9xDw+KEjJnfAKX++7ZLSd03tBT9B8oBgfF136m86B+5ekoGYu17TDfJyomuCjjo n/5XDELNhNclcKMmGuszDjsROb3MXf8LJZHHs0+cnMrq47gozIGZaip10NEMAw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1700168080; a=rsa-sha256; cv=none; b=TGzOuM0Mn1w+46C9wTgF6/TNjoCQ8qjHpz6xEQcAPpyI9sf8YK4q/Frvq9AF8q7QwDekv9 Mwabr1H4nK4o+le1mB6u7Mr+yWJFy9y/DilmSEqE62yYBAji+jiawvHBtt6sNjBr2aog+x 5rZ7/GGfjPZ1qxwG4wrXt3H2XQ1caFanV0miqgGUtWxpHgy+AEoUgmB5uZerKgRNi2/PfX +lJ4PBVw+NJJk5HiJB4l10jHzllmEuGnCWpkgFa8UwfIymPZZFbppzmz8jRFn0BtbN06Bv 2/UlNYPKH535Izka8iQk0fgT/6cS36ndRIODnGnIM3ydZes2DrjhguCTAkSuvQ== 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 4SWXN059fyz1NK; Thu, 16 Nov 2023 20:54:40 +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 3AGKseBe053711; Thu, 16 Nov 2023 20:54:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3AGKseNQ053708; Thu, 16 Nov 2023 20:54:40 GMT (envelope-from git) Date: Thu, 16 Nov 2023 20:54:40 GMT Message-Id: <202311162054.3AGKseNQ053708@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: c98dded0c762 - stable/14 - uma: UMA_ALIGN_CACHE: Resolve the proper value at use point 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: c98dded0c76266740e94ac53e8a2f02be1d61e4f Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c98dded0c76266740e94ac53e8a2f02be1d61e4f commit c98dded0c76266740e94ac53e8a2f02be1d61e4f Author: Olivier Certner AuthorDate: 2023-10-13 12:13:30 +0000 Commit: Mark Johnston CommitDate: 2023-11-16 15:07:11 +0000 uma: UMA_ALIGN_CACHE: Resolve the proper value at use point Having a special value of -1 that is resolved internally to 'uma_align_cache' provides no significant advantages and prevents changing that variable to an unsigned type, which is natural for an alignment mask. So suppress it and replace its use with a call to uma_get_align_mask(). The small overhead of the added function call is irrelevant since UMA_ALIGN_CACHE is only used when creating new zones, which is not performance critical. Reviewed by: markj, kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D42259 (cherry picked from commit e557eafe7233f8231c1f5f5b098e4bab8e818645) --- sys/vm/uma.h | 2 +- sys/vm/uma_core.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/vm/uma.h b/sys/vm/uma.h index 793f9af3dace..4bf23534ed27 100644 --- a/sys/vm/uma.h +++ b/sys/vm/uma.h @@ -301,7 +301,7 @@ uma_zone_t uma_zcache_create(const char *name, int size, uma_ctor ctor, #define UMA_ALIGN_INT (sizeof(int) - 1) /* "" int */ #define UMA_ALIGN_SHORT (sizeof(short) - 1) /* "" short */ #define UMA_ALIGN_CHAR (sizeof(char) - 1) /* "" char */ -#define UMA_ALIGN_CACHE (0 - 1) /* Cache line size align */ +#define UMA_ALIGN_CACHE (uma_get_cache_align_mask()) /* Cache line size align */ #define UMA_ALIGNOF(type) (_Alignof(type) - 1) /* Alignment fit for 'type' */ #define UMA_ANYDOMAIN -1 /* Special value for domain search. */ diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c index 6e83a27bab27..b74fbd57e77f 100644 --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -3243,7 +3243,7 @@ uma_kcreate(uma_zone_t zone, size_t size, uma_init uminit, uma_fini fini, args.size = size; args.uminit = uminit; args.fini = fini; - args.align = (align == UMA_ALIGN_CACHE) ? uma_cache_align_mask : align; + args.align = align; args.flags = flags; args.zone = zone; return (zone_alloc_item(kegs, &args, UMA_ANYDOMAIN, M_WAITOK)); @@ -3256,7 +3256,6 @@ uma_set_cache_align_mask(int mask) { if (mask >= 0) - /* UMA_ALIGN_CACHE is also not permitted here. */ uma_cache_align_mask = mask; }