From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by sourceware.org (Postfix) with ESMTPS id 779B53858D28 for ; Tue, 7 Dec 2021 07:47:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 779B53858D28 Received: by mail-pf1-x42d.google.com with SMTP id g18so12653529pfk.5 for ; Mon, 06 Dec 2021 23:47:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5AZVfN9D2YU0Dy6FdJCQl3S630I34o/BfkkJnwt7HjQ=; b=vPsi+rj23WmkY5+MoO7rKorxS+G8imQ/BAPOE6SzPSrNgmqT3rjab6cy/CI3e5dztA Qbs3igOwx9EAeG5iY0M5/eb90eUesHAYTAGEF21PjitSgXUvqR3VGAiAofJgdRRU5nwl 8HcK4czQWk8NwGZ5E155ivkwtVBFCwK7EA+Kqij/sw3eBfJ6b+FOAZLAMyKn+LcX4qng acporYE6gNo9j2fnotIBVbj1Zn6/Hz9ttoOApJBRpUNtBXY4P/5103mavqB0/77gDp/c 155LPmGw72dliCd3anxDipHDti1alzw3hT1v7uZhj+hM7KN/u7ZJDiBJL9K/8LUjp69L jbnQ== X-Gm-Message-State: AOAM530Ugn5FwjSJuyzT40ELdOupepSRyxKlGIV/OyGh+vngsjxn2G0Q KbZN3H7T/PnwIJgtP9WQUW+FS8pqrLPXtKDqvOkSngkyCGI= X-Google-Smtp-Source: ABdhPJwiL8W58tH+ot1w3blhLjAcZevqyXAnJFx7Ut94N3pO32dp7KDduCp1WnbgsiqOtDxLVKyMGEZAnjgIdQeCg74= X-Received: by 2002:a63:1217:: with SMTP id h23mr23108568pgl.18.1638863233690; Mon, 06 Dec 2021 23:47:13 -0800 (PST) MIME-Version: 1.0 References: <20211206032303.7159-1-hjl.tools@gmail.com> In-Reply-To: <20211206032303.7159-1-hjl.tools@gmail.com> From: Noah Goldstein Date: Tue, 7 Dec 2021 01:47:02 -0600 Message-ID: Subject: Re: [PATCH] x86: Don't set Prefer_No_AVX512 for processors with AVX512 and AVX-VNNI To: "H.J. Lu" Cc: GNU C Library Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2021 07:47:15 -0000 On Sun, Dec 5, 2021 at 9:23 PM H.J. Lu via Libc-alpha wrote: > > Don't set Prefer_No_AVX512 on processors with AVX512 and AVX-VNNI since > they won't lower CPU frequency when ZMM load and store instructions are > used. > --- > sysdeps/x86/cpu-features.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/sysdeps/x86/cpu-features.c b/sysdeps/x86/cpu-features.c > index be2498b2e7..311ade1f26 100644 > --- a/sysdeps/x86/cpu-features.c > +++ b/sysdeps/x86/cpu-features.c > @@ -538,8 +538,11 @@ init_cpu_features (struct cpu_features *cpu_features) > |= bit_arch_Prefer_No_VZEROUPPER; > else > { > - cpu_features->preferred[index_arch_Prefer_No_AVX512] > - |= bit_arch_Prefer_No_AVX512; > + /* Processors with AVX512 and AVX-VNNI won't lower CPU frequency > + when ZMM load and store instructions are used. */ > + if (!CPU_FEATURES_CPU_P (cpu_features, AVX_VNNI)) > + cpu_features->preferred[index_arch_Prefer_No_AVX512] > + |= bit_arch_Prefer_No_AVX512; > > /* Avoid RTM abort triggered by VZEROUPPER inside a > transactionally executing RTM region. */ > -- > 2.33.1 > Should we also do Rocket Lake? According to Travis Downs at least downclocking is an issue there ether: https://travisdowns.github.io/blog/2020/08/19/icl-avx512-freq.html#rocket-lake