Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2283576ybk; Mon, 11 May 2020 17:14:03 -0700 (PDT) X-Google-Smtp-Source: APiQypJAx5XKdjYF1qdku99LCipDyO+OKvN1gig7qVEOECOFMimsPiUsTPOHzCrw9X87/UcdU2l5 X-Received: by 2002:a05:6402:22d5:: with SMTP id dm21mr15257228edb.275.1589242443509; Mon, 11 May 2020 17:14:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589242443; cv=none; d=google.com; s=arc-20160816; b=wdZaVME24QuOTbZoKNE7QIX6Ac/tasJcYDL05Ev7Rhsw3lLJ8DzHwkoUOrmiGIa71R yGCnkGxswEAbjtAvW2Wf1IZ3tnsp1XWI96ZBhZ6xVrMMxl//gOJQcADrbqKDWvJcVxil GcZD8jVqzK2yuyohic2N8Zb1ahos0ER/ur2hSLIXTgwpe9okH4+j0JSQsHY9GJYaHXc6 FHAr5QNNvYlb+kShyFl5osO5KxtFl5W5MK6V1yoOYcvO0z6U0nTqbHDleRvnqOkSMy3V P/+nxk5xKZRzR+UYOq4939AU5ejNl9DiXghlbIFNnP4v9FzrKY/1lawNkf0A+g6XpcQU thXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=B+GIuNeS/zRhNXv8DWJcBs5sdIAbLbnMHoFTqitLrys=; b=xN9rgh3rJhZRITzGGKZz7/si8STHa+uyVUYsPC6XR1zMUnUQOzqFvHytD7QYqMXEsP MHrH62G095YvBMx9NrGxiGkwTvL9/Ib090EPnHV3/rtufNQ9T0M6S9/a/jATFAxI2rDD 3jJxtFHhQIgc36u/6+NGfBABm1r0uFpAE992EFLkNrEx22CkKk+PHo5uRTZd5HdoIh5p /kyfK/I0SAe78grqN8xTgYy+v/duf9Vlx7zRdQiCuHreC921HIlQim2tmyt+zR0yPDrU ed2kD0qLSnsDrvT8FdqTSESvIOSivGO1OFREpyFaADvCnEWMMRxuyi6oMywjFDqcchms yOqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Ak93bane; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w7si6261246edr.309.2020.05.11.17.13.40; Mon, 11 May 2020 17:14:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Ak93bane; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728319AbgELAJl (ORCPT + 99 others); Mon, 11 May 2020 20:09:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728309AbgELAJk (ORCPT ); Mon, 11 May 2020 20:09:40 -0400 Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39F16C061A0E for ; Mon, 11 May 2020 17:09:40 -0700 (PDT) Received: by mail-lj1-x242.google.com with SMTP id w10so846819ljo.0 for ; Mon, 11 May 2020 17:09:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=B+GIuNeS/zRhNXv8DWJcBs5sdIAbLbnMHoFTqitLrys=; b=Ak93banedsJMiV/GLzQObSSQW5MNVGozwtSadLdbb2llutUOeMawnVzTXwPyZMhdn5 zotibDunSZiYNCo1pURopX//M2oItuHBRSCOe5QbWLnCSD0k+LJAL7kMlmILXXDpJpO1 SUoeWuk79IlnBSAlPr/pRc1vZh5tqtqot+UYY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=B+GIuNeS/zRhNXv8DWJcBs5sdIAbLbnMHoFTqitLrys=; b=NjwXGFygqBj8ZxoCBI9IjisNDd/vmke4PfkW4iCK2w7K5r05UKJoV3XypgoolSrDdm jBuxvbYTEkYSvJi4rqvno9tH09U2UilLjW4eTMcvJ4brxEtH6rYRlDCiu7mLJaTL7L8N Tsyl76IRBKsVMqzJvnYSVZe1WhOIvI3Zui4s7SXE79o7wRlQRnHT5wjKRhPi9B7E+iC8 nUhqdVKWVadH+PAkkVBDHVsbdeR1IWZhNgCuGN0uMK6s12rXq8IYGb5Ty5yWiUEyX7wJ Uxyt108QbyMa/XgC9W3PjrmyTT2RsmD/rKnYF6zTNtfyJewAlLfBWWXkdNRwm1BQg2G2 nmUw== X-Gm-Message-State: AOAM533EBqzo5SswSuMNd5FXA5PsUa2FMWPqsi92IJm3PJPPNf/aO+Dp zwuDF0HnPi0Rm5+hcwkwzvniiWoAtlo= X-Received: by 2002:a2e:8e68:: with SMTP id t8mr11580712ljk.93.1589242177934; Mon, 11 May 2020 17:09:37 -0700 (PDT) Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com. [209.85.208.182]) by smtp.gmail.com with ESMTPSA id k22sm11381938ljj.85.2020.05.11.17.09.36 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 May 2020 17:09:37 -0700 (PDT) Received: by mail-lj1-f182.google.com with SMTP id u15so11593970ljd.3 for ; Mon, 11 May 2020 17:09:36 -0700 (PDT) X-Received: by 2002:a2e:9a54:: with SMTP id k20mr12584970ljj.265.1589242176533; Mon, 11 May 2020 17:09:36 -0700 (PDT) MIME-Version: 1.0 References: <20200508090202.7s3kcqpvpxx32syu@butterfly.localdomain> <20200511215720.303181-1-Jason@zx2c4.com> In-Reply-To: From: Linus Torvalds Date: Mon, 11 May 2020 17:09:20 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] Kconfig: default to CC_OPTIMIZE_FOR_PERFORMANCE_O3 for gcc >= 10 To: "Jason A. Donenfeld" Cc: Linux Kernel Mailing List , Linux Kbuild mailing list , "the arch/x86 maintainers" , stable , "H.J. Lu" , Peter Zijlstra , Jakub Jelinek , Oleksandr Natalenko , Arnd Bergmann , Andrew Morton , David Laight , Masahiro Yamada Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 11, 2020 at 5:04 PM Linus Torvalds wrote: > > Not inlining as aggressively is not necessarily a bad thing. It can > be, of course. But I've actually also done gcc bugreports about gcc > inlining too much, and generating _worse_ code as a result (ie > inlinging things that were behind an "if (unlikely())" test, and > causing the likely path to grow a stack fram and stack spills as a > result). In case people care, the bugzilla case I mentioned is this one: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49194 with example code on why it's actively wrong to inline. Obviously, in the kernel, we can fix the obvious cases with "noinline" and "always_inline", but those take care of the outliers. Having a compiler that does reasonably well by default is a good thing, and that very much includes *not* inlining mindlessly. Linus