From patchwork Thu Feb 8 13:08:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 770851 Delivered-To: patch@linaro.org Received: by 2002:adf:9dca:0:b0:33b:4db1:f5b3 with SMTP id q10csp311262wre; Thu, 8 Feb 2024 05:09:53 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWvL1fSLcEmez8Im9zHOU7wSi+/xgMqnytZJwSVQX9vptf9h8ZJq2PmfkTqKLdXGqSwwJOm1S4LIO6Yk0YoNe9b X-Google-Smtp-Source: AGHT+IGJnH+ozyqpEr5tBZfCyYp4g0LiahQo/QlILrNS8dfcVuCB6LSXwMHTij171XPrBv/Q/w+n X-Received: by 2002:ac8:4243:0:b0:42c:4771:79c3 with SMTP id r3-20020ac84243000000b0042c477179c3mr2461847qtm.66.1707397793363; Thu, 08 Feb 2024 05:09:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707397793; cv=pass; d=google.com; s=arc-20160816; b=o4zojH5ES3f9fn8CysMPpkjue4KQx4nvQlWx2npeeqrQGgLw6GQpTmybw3nsv9nwzM 5tRVm50reSvbW/I4MU/uGbx57LfVZPEoUa9wyRec5V80RLwxOP19U12D7WhE9PPBqBqa nIEyejsOh1LeAferNqtByuWNJhc2w4Ym2fsPn8z4TSdDvuSKMbdxmbYtqyG/+0XsD0PK UvckHOXRepOHla4sPNfuy2rkD0w4dZKjWTRcEE1/DJx6jEhXfc6sv8yrCeC+HxhhOGPz 26chzsEBwCQqFLfH8p59zs0SuXKu/H6cwh5sjTXvvEjfGhbtrsF3oqM/IeDbqd5DbpQM x1Yg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=b5wsbm9BSPv8Z6b84ObY/vrxF/C+AQXAZoSPnUTkPBs=; fh=DdY3pZvR5hCKI0nr6iNieK/KFShWXEZXyEIMdfhnIlA=; b=ERPCgN9dotxSJ0HfBQchy3GWMBGcZ3DsnG7xcQIcIcV2lcIgxX7FLf+hIXmyqrgq/p D8cS+JBiQ2CnITRfbS28o6e+AN+pfBbaQ4EpkaOKeODbuZ8v+wg/MVHPy0LrUtvh7Ojw sviNYpRYYM929f4ZjU7j50X8cjqO8kww0R8oOIdsfG8qlHfBP8qf0KuTVQXd/xGfoogG BUtRtjAMmywZ4t3emrAzOQPK/H8D9b0k2HH1TFAuvVMVGta1j2HStxBe+Th9f8gOM1r9 ZAQH0gbOykGibXoqLV8ev2+1y+ujYWwHNZ5/p9yGaS94cJ/TDowKWpmtoQncefZNp+CM dPMw==; darn=linaro.org ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="DIz/hjll"; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="libc-alpha-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=2; AJvYcCW+un/G58+nkFNU/KtCXghLOmAbElM6iIZmt027g8g3YRxvLeHRQDFuRq78V4Ck15L4xqgrfE4EB3p2iSPtqFyg Return-Path: Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id a5-20020a05622a02c500b0042c450f1144si2495727qtx.357.2024.02.08.05.09.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 05:09:53 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="DIz/hjll"; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="libc-alpha-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BEDC9385842B for ; Thu, 8 Feb 2024 13:09:52 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by sourceware.org (Postfix) with ESMTPS id 7E8DD385829B for ; Thu, 8 Feb 2024 13:08:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7E8DD385829B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7E8DD385829B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::635 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707397734; cv=none; b=IJFvEEBnjS30FyE0wasIWpE4C3iRu+NbF5iBYWidBxCB5oOH4qK84jVE8D6U8E8qmlkRxe+dBg9Ki/mNUSqg7Y0+mhGc+dD7LAhQvjPhNC7typ+ZjRtaMXoVqoeS885FgJwMjhZ3URp7VhaHeO6ZoMWXNxECCgj92TOOu37gUgM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707397734; c=relaxed/simple; bh=Ch559aowFxilJioZ5WAccV0cVW/v+zYbT7cvanPw3CU=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=EiJ7K28dOaupvkpqW5AR3xG44SdDD+HhuYDO50I4ntcOfrPddopikIlr1X0G08uOAQVytWYkI3+466zBXL5J9wZSmO/h2kjAuN9Lkbz5kiNnS6y1GmCdtqfcI14UsKWEJ8NKWfsMq+0tw1DoHFIZcWt2ORtzigZY0p+u12QxTbI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1d7393de183so15389835ad.3 for ; Thu, 08 Feb 2024 05:08:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707397731; x=1708002531; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=b5wsbm9BSPv8Z6b84ObY/vrxF/C+AQXAZoSPnUTkPBs=; b=DIz/hjllBAqcpEJFdETiOe0tTEru6ur+CH1ebgxhqIxd8arlojkZczO0aRsRgvVFk4 +osmIQGmUl0V1ghr2bH9Qk/U+ngvxLKiZOI1gyweZLEUoYEjyLe87CaCqAqeW+Jet12s 8hMY7+hGHhVGSYuj8FtgB1fvQ3VrlB/zaX1U8pD6S7c85lwcqs9gSUfiBEZpilSUqM6O jig+qRAR2ab/YmN4FdqumHAiNlc8k+TufhLA1GqpsY7YDELBmpKHIXuIDspzo4zw6YPi Lm5xftEAQ6N3DBTZ+bpYa9nO/K/DK+xRUjmGGaq9qZPlEG1gZdlEnNR2VJeVYo6X7tIH 0b+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707397731; x=1708002531; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=b5wsbm9BSPv8Z6b84ObY/vrxF/C+AQXAZoSPnUTkPBs=; b=tD3wP4dujyOiVYWsz3keZ/phXuAhk7Aon5zvjBFYEnF2SWZdaDKAXjxENBB8RNVt9L Y1uZaYs5VnMV5Z8LUZRfnm+s900XIwwbsoBpHw5da+4CMzTVJG7nmRwDdSqtS9Udi7qQ IV1zcTJLq/C4GJk7+V0wONFkOLYygNRA++SFqoBdL0AvdhNXVH1hj3p6/Jygw2yqHYO0 cy3P82w4UckEwh+Omyqw5Z2IToU7aldXVUSfmUdEKXsNPBm/vymK+qTrKG9xgXsllN0g 1U0sPGv/kD6ir3m/YHkdkCZwNBwXgDIuXyYF1BWANUOmyxYA3MBblCsJL3NmMsrPpeNa qfSw== X-Gm-Message-State: AOJu0YyltBuxDRMbkDIemrOYbmLKbmxkCMXNlWrJRvQcEgyC+VbmXMPs OajdrxxsHbd/9C11gfgbR/kcOh5lJC+FFJQ0WoyngIcz1GG0XBdsAddxqaiBURSodDC19keCrKu R X-Received: by 2002:a17:902:ce86:b0:1d9:65e6:4acc with SMTP id f6-20020a170902ce8600b001d965e64accmr9413666plg.42.1707397730860; Thu, 08 Feb 2024 05:08:50 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUaw6A9zju5zpMcRwlw0Xpd+wVFqP9Qf7cIhmGntAeI4HVKcKSHCpBpNVYtqsShH383xh2PgESu9zJUVZ3/l5O+UEWVVGNNB0/dEjvWjvoTiNxFioskIgiMHfsAcI7AN2Kl3FR3kWwTpztv00eEkRkX4pFijh8J3uDsyitD93/LNpqxS18s9SjsOA== Received: from mandiga.. ([2804:1b3:a7c0:378:6793:1dc3:1346:d6d6]) by smtp.gmail.com with ESMTPSA id 4-20020a170902c14400b001d9fc535378sm1844083plj.236.2024.02.08.05.08.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 05:08:50 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: "H . J . Lu" , Noah Goldstein , Sajan Karumanchi , bmerry@sarao.ac.za, pmallapp@amd.com Subject: [PATCH v3 2/3] x86: Do not prefer ERMS for memset on Zen3+ Date: Thu, 8 Feb 2024 10:08:39 -0300 Message-Id: <20240208130840.533348-3-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240208130840.533348-1-adhemerval.zanella@linaro.org> References: <20240208130840.533348-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patch=linaro.org@sourceware.org For AMD Zen3+ architecture, the performance of the vectorized loop is slightly better than ERMS. Checked on x86_64-linux-gnu on Zen3. Reviewed-by: H.J. Lu --- sysdeps/x86/dl-cacheinfo.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sysdeps/x86/dl-cacheinfo.h b/sysdeps/x86/dl-cacheinfo.h index f34d12846c..5a98f70364 100644 --- a/sysdeps/x86/dl-cacheinfo.h +++ b/sysdeps/x86/dl-cacheinfo.h @@ -1021,6 +1021,11 @@ dl_init_cacheinfo (struct cpu_features *cpu_features) minimum value is fixed. */ rep_stosb_threshold = TUNABLE_GET (x86_rep_stosb_threshold, long int, NULL); + if (cpu_features->basic.kind == arch_kind_amd + && !TUNABLE_IS_INITIALIZED (x86_rep_stosb_threshold)) + /* For AMD Zen3+ architecture, the performance of the vectorized loop is + slightly better than ERMS. */ + rep_stosb_threshold = SIZE_MAX; TUNABLE_SET_WITH_BOUNDS (x86_data_cache_size, data, 0, SIZE_MAX); TUNABLE_SET_WITH_BOUNDS (x86_shared_cache_size, shared, 0, SIZE_MAX);