Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1510405pxb; Thu, 24 Mar 2022 23:12:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbhzSD1rszoURFBQyh6KQD38kK0Nlj0Wk6kbYAeLGDlwIfPNWpvDG75LdRk+uCFmLZGEry X-Received: by 2002:a05:6402:1e96:b0:418:ff57:ada2 with SMTP id f22-20020a0564021e9600b00418ff57ada2mr11227603edf.197.1648188749555; Thu, 24 Mar 2022 23:12:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648188749; cv=none; d=google.com; s=arc-20160816; b=Sx8apKxZH6C36YvhlJ+hyjN3CDxMqzjT1wgF+8aLdweRReMyWmaZhma2jUpxT7g0wR /zeyJ1kwSEnMAWkWT2t4mivmY66BDukvZ4FrmYEZe7wjIO8bixSn0514MJ6pTxdFkVnh JCzspx1AxZ1F0/lqGgWpa6NFChKfoIetCHXdyEMAcX3qRoW+mJkkSID13Ja+arY4g+Z7 5d4l6aaTaAF1BEJXYXJttf4lx9XIQfEr5ySWpvKMpMW7YNuBGKeN+G/rWsd61jtD8EoX BjsJqyb2vqKq7f2QtRUtL3G36hZlkZcVUmQpRJLEhRztCJQ5jlbmDoG2MwSfM6vmhXd2 ldGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=tyTpYV+qLd3kiCOmwuwEqZzrCGB5RjcTEwNX2Jl7UEA=; b=WBHfm5RiVZg9mrzzqo+vDFbpkSvHj/mYl6T1ySareOiuHoWLGYEmxwrPbNyQWYqF9t ZcMYg8pPSjYqX2cUYkfv3cqvzZNKl093MYvZ86qkrI4Uce0oPzX2AmSORniCVM+mEtsC /C40OT/mqBd1F4lGjbUs7Ne2zST9X3+1hcjDMyEqGCqQzUcJYB6nhtUiWyHN198tUobU 7tO2o1p2IcY+1FQIEBNliY9tc0cbg2nUtL/4dtmLRAEbMBX8m77iKi/N70s4s8tyVcRz sxhOxPUW4waHvmHGTxX/qrANvCc124/vXjC/rNJigAv6G5pYjkAAhiUSM16ceuGKhwBU Sljw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=N36LSw7J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v18-20020a50d092000000b00418c2b5bf7csi1841764edd.606.2022.03.24.23.12.03; Thu, 24 Mar 2022 23:12:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=N36LSw7J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353076AbiCXXVi (ORCPT + 99 others); Thu, 24 Mar 2022 19:21:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355752AbiCXXVd (ORCPT ); Thu, 24 Mar 2022 19:21:33 -0400 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09E16554B3 for ; Thu, 24 Mar 2022 16:20:01 -0700 (PDT) Received: by mail-pj1-x1034.google.com with SMTP id v4so6024199pjh.2 for ; Thu, 24 Mar 2022 16:20:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=tyTpYV+qLd3kiCOmwuwEqZzrCGB5RjcTEwNX2Jl7UEA=; b=N36LSw7J4Ad6KB9y5Sj67YKYV6mXZvsH8bYHCiyCwTOj6H63DijLBlEMv450NCtV8u kQHcDEkhXKCmkiSkTCUpis6/nucGUmAwtRR5L5bIrcD7hu1YE/8SEGjoqBSrLHqfHSsn 4WmIEKf0WmMgkWJviaxiy+MgajPclr9xWrNW5KYY9e1SAimz6Q0pB0h8NRm5AkJb8C5F VJ1ilbu9bVqZJuT7x3W33NfbRrXUB3c19FITLo0XeVxms7QGftQC76GGU+4+Co8Pwdp2 g18Q8YZWb+NKtxiqD8wYZE0nSw/usHc4WTDa16QVgGC8BVewlqWd3hnziRHQMyrTJcei Ankw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=tyTpYV+qLd3kiCOmwuwEqZzrCGB5RjcTEwNX2Jl7UEA=; b=bIxXPhEDiE0+KuazzKJr5uUNpukufT3lRsw93bbonvQXTCFFcf6wxsV0KOV8nZq8vY KuCh9f4bzdxF8GFxIljSY03R17eT96O8B5UMZWBYug+nEGrE7MshT5wHud5cFPYx4A4V m1pps9hGCfbR8vNS6CM/c3SaRcDP6NmgQd5eNSf6Gf8of1Ec8OxgN15418u+NfsH8ahy pUr8XoZRKTeZDZEyc11XCmQ9DIQkCAOEsBPPXxMDj4f0q2VEDzQZ+pp7kHVlrQ659Q5k Gd0EY9YjJz28IfV9PXF2/Rtqt7F0EsLsDz9CDuWCZFpSw45TDmuyiYDHrLvhGsvIFbmf m3Rg== X-Gm-Message-State: AOAM531L0UZHabO7L1/Ft7XpT0A5vYzFQ8rC3EvUBhOqzs3KkurdFzd/ pB8wegJbjNNwkQxltA1EM2ckiA== X-Received: by 2002:a17:90a:c595:b0:1c7:bb62:4487 with SMTP id l21-20020a17090ac59500b001c7bb624487mr6473841pjt.190.1648164000136; Thu, 24 Mar 2022 16:20:00 -0700 (PDT) Received: from google.com ([2620:15c:211:202:7198:79bb:dcac:4972]) by smtp.gmail.com with ESMTPSA id t7-20020a056a0021c700b004f737480bb8sm4446746pfj.4.2022.03.24.16.19.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Mar 2022 16:19:58 -0700 (PDT) Date: Thu, 24 Mar 2022 16:19:49 -0700 From: Nick Desaulniers To: Borislav Petkov Cc: Ingo Molnar , Linus Torvalds , Linux Kernel Mailing List , Peter Zijlstra , Will Deacon , Waiman Long , Boqun Feng , Thomas Gleixner , Andrew Morton , clang-built-linux , Sylvestre Ledru Subject: Re: [GIT PULL] locking changes for v5.18 Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 24, 2022 at 11:19:58AM +0100, Borislav Petkov wrote: > On Thu, Mar 24, 2022 at 09:40:24AM +0100, Ingo Molnar wrote: > > Only intermittently on my side - it only recently started working > > reliably & it doubles the not inconsiderable test time :-/ > > True dat - last time I measured, clang builds take roughly double the > time gcc builds with the same config do. See also: https://lore.kernel.org/lkml/CAHk-=whs8QZf3YnifdLv57+FhBi5_WeNTG1B-suOES=RcUSmQg@mail.gmail.com/ We do have to pay a penalty in that if these binaries can be built as shared objects, the MUST be. (Actually, IDK if Debian has the same policy as Fedora). If you see libLLVM-*.so (and libclang-cpp.so) in your list of `ldd $(which clang)`, or see multiple symbols from the dynamic linker after running: $ perf record -e cycles:pp --call-graph lbr make LLVM=1 $ perf report --no-children --sort=dso,cycles Then dynamic linking is the main source of performance difference between GCC and Clang on those distributions. So we're kind of fighting with one hand behind our backs. For Linux distros that have server costs, my guess is these policies allow them to minimize their costs of serving prebuilt binaries, since dynamic linking does allow for smaller binaries. For short lived processes like most of the toolchain (and parts that generally don't overlap, such as the serialization between compilation THEN linkages), dynamic linking provides a ridiculous startup cost. CoW gets us most of the benefits of dynamic linking in terms of shared memory between processes. (I don't think ASLR hurts CoW in that way?) On the flip side, I have been banging pots and pans around internally trying to raise awareness of the issue (I'm but a peasant though, Mr. bottom rung of the ladder); we do have budget finally allocated to focus on compiler performance. Getting the checks written involves more red tape and more effort than I expected. I might start ignoring compiler bugs for a while, go off into the wilderness, and not come back until I have statically linked images of clang available to host on kernel.org though. There's a lot we could be doing to hot rod the compiler to optimize for developer's (and CI's) time.