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 Netto X-Patchwork-Id: 85462 X-Patchwork-Delegate: hjl.tools@gmail.com Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EE91C385840F for ; Thu, 8 Feb 2024 13:10:03 +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-Google-Smtp-Source: AGHT+IHvdmpaEF6T7VfJ5dzblRxy9M/f6qOq7BJ9qBbcuJQmXU7mK2IVTES1C36JUzhxPy3p9LivUg== 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+patchwork=sourceware.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);