From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8633C433DB for ; Fri, 26 Mar 2021 20:36:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BE14461945 for ; Fri, 26 Mar 2021 20:36:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230170AbhCZUfn convert rfc822-to-8bit (ORCPT ); Fri, 26 Mar 2021 16:35:43 -0400 Received: from albireo.enyo.de ([37.24.231.21]:55738 "EHLO albireo.enyo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230003AbhCZUfe (ORCPT ); Fri, 26 Mar 2021 16:35:34 -0400 Received: from [172.17.203.2] (port=40449 helo=deneb.enyo.de) by albireo.enyo.de ([172.17.140.2]) with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1lPtB0-00038H-F0; Fri, 26 Mar 2021 20:35:26 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.92) (envelope-from ) id 1lPtB0-0008Aa-CB; Fri, 26 Mar 2021 21:35:26 +0100 From: Florian Weimer To: Andy Lutomirski Cc: "H. J. Lu" , X86 ML , LKML , "Bae\, Chang Seok" , "Carlos O'Donell" , Rich Felker , libc-alpha Subject: Re: Why does glibc use AVX-512? References: <87a6qqi064.fsf@mid.deneb.enyo.de> <87blb5d7zx.fsf@mid.deneb.enyo.de> Date: Fri, 26 Mar 2021 21:35:26 +0100 In-Reply-To: (Andy Lutomirski's message of "Fri, 26 Mar 2021 12:47:42 -0700") Message-ID: <877dltd569.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Andy Lutomirski: > On Fri, Mar 26, 2021 at 12:34 PM Florian Weimer wrote: >> x86: Sporadic failures in tst-cpu-features-cpuinfo >> > > It's worth noting that recent microcode updates have make RTM > considerably less likely to actually work on many parts. It's > possible you should just disable it. :( Sorry, I'm not sure who should disable it. Let me sum up the situation: We have a request for a performance enhancement in glibc, so that applications can use it on server parts where RTM actually works. For CPUs that support AVX-512, we may be able to meet that with a change that uses the new 256-bit registers, t avoid the %xmm transition penalty. (This is the easy case, hopefully—there shouldn't be any frequency issues associated with that, and if the kernel doesn't optimize the context switch today, that's a nonissue as well.) For CPUs that do not support AVX-512 but support RTM (and AVX2), we need a dynamic run-time check whether the string function is invoked in a transaction. In that case, we need to use VZEROALL instead of VZEROUPPER. (It's apparently too costly to issue VZEROALL unconditionally.) All this needs to work transparently without user intervention. We cannot require firmware upgrades to fix the incorrect RTM reporting issue (the bug I referenced). I think we can require software updates which tell glibc when to use RTM-enabled string functions if the dynamic selection does not work (either for performance reasons, or because of the RTM reporting bug). I want to avoid a situation where one in eight processes fail to work correctly because the CPUID checks ran on CPU 0, where RTM is reported as available, and then we trap when executing XTEST on other CPUs.