Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1779226rwb; Thu, 17 Nov 2022 01:42:38 -0800 (PST) X-Google-Smtp-Source: AA0mqf4JTB5JlzAFR1NiTjTC13Gry+6BSC1BN4C5cLihB5iGVa38kV6LTb1nS/ONV5GtGD2KeTgb X-Received: by 2002:a17:906:3549:b0:7aa:ffd0:cbec with SMTP id s9-20020a170906354900b007aaffd0cbecmr1417292eja.758.1668678158043; Thu, 17 Nov 2022 01:42:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668678158; cv=none; d=google.com; s=arc-20160816; b=gVENVKU796wuAOlFD/WcQE8vISeiedoHnD14Zixr+cscJ65PmV00lhnvp2VfQLgIiL 9ikQJtjUJkpdRJfQ4FENhgZgqIR7pej2pM+3D/CrRx4TfzHIZOfG/EAZbJ+6bOXVHClz Db3ktdwSrEClCLHKP7a1ZqGrmkd5/wkWWGdUUapfUL2aN/04kx5j+ltJIs8Qb/BpUVXN BGjUmIXY0U+5jwq9fW7pGj+qfaoxjYlpR7tYvOtqURPLu9SZV1pDfh6TmKnEjOKQ2E5u +Mc3iyYe5Wce+LpFDrWqZQX8qP173UUd3rUBJ44Rt1t9iLq1mfyJdLlKbxVI969YNYLr YYow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature:dkim-signature; bh=PbgsIrs+bZ9iovtRdSQCKoVjk+AKuPaJdvditHit2RA=; b=VpBUV+fTJWQ0u6bTRC7X1y37b6MIc7DYqJgm9dBuzJhU7kxNvg2UYFt4htb9TcIDKi lDXh6kJfBd0D8qTKnRksuMucvkyffRaayM1ZobVfKEDI4zuwuucOfvg1cWrHBQ+qvVtK m9a/aSRci6WjDx+2gmB95sp2HcyabWC0RlnhoIXBytRykOvW8QwmlO28B1fMD7mjMtho yU9U1j4aB6wFqAE6BRlDjNfhhAndVJD5BcH38fk8QAZyFdg7BFyfCT42ofvkN0Cfxqqk VYM8Tww3EL/1dgPb0tU6SChZMVzAUs9BJEVWxLZoxjr1Ycy1pKmnucABIgVR9OCsPpUL Q0KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=AY3fjItg; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=j+8OvQeI; 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=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m8-20020aa7c488000000b00461b8e2c7f4si423206edq.548.2022.11.17.01.42.15; Thu, 17 Nov 2022 01:42:38 -0800 (PST) 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=@suse.de header.s=susede2_rsa header.b=AY3fjItg; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=j+8OvQeI; 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=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234480AbiKQIvR (ORCPT + 92 others); Thu, 17 Nov 2022 03:51:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239570AbiKQIvL (ORCPT ); Thu, 17 Nov 2022 03:51:11 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2339D51301 for ; Thu, 17 Nov 2022 00:51:02 -0800 (PST) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id A2822228B5; Thu, 17 Nov 2022 08:51:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1668675060; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PbgsIrs+bZ9iovtRdSQCKoVjk+AKuPaJdvditHit2RA=; b=AY3fjItgBpSZyc9SXC/fV8iI0exxRfeouBLgpNBBGTwdMxzCbmb1Ld3pi2GGVupI4DILJ7 FTrwQOUQliqufCT8DYtfJLhuhI9goiKF7wbLitOj5Sy+19XlqFEu5vetAlgRTwFPCDVjpx HsXjYwnMmRmBzWqxGh2OfekNMFmM3Pc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1668675060; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PbgsIrs+bZ9iovtRdSQCKoVjk+AKuPaJdvditHit2RA=; b=j+8OvQeIpYpnk0GD8bGyWYZgelfz3m0h+Ifhiy4UMsxavf7ByLKHVQJUleUUDdDYih5oda Rj0N7YwnZCDpSWDQ== Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id D52B42C141; Thu, 17 Nov 2022 08:50:59 +0000 (UTC) Date: Thu, 17 Nov 2022 08:50:59 +0000 (UTC) From: Richard Biener To: Peter Zijlstra cc: Ard Biesheuvel , "Jiri Slaby (SUSE)" , linux-kernel@vger.kernel.org, Alexander Potapenko , Alexander Shishkin , Alexei Starovoitov , Alexey Makhalov , Andrew Morton , Andrey Konovalov , Andrey Ryabinin , Andrii Nakryiko , Andy Lutomirski , Arnaldo Carvalho de Melo , Ben Segall , Borislav Petkov , Daniel Borkmann , Daniel Bristot de Oliveira , Dave Hansen , Dietmar Eggemann , Dmitry Vyukov , Don Zickus , Hao Luo , "H . J . Lu" , "H. Peter Anvin" , Huang Rui , Ingo Molnar , Jan Hubicka , Jason Baron , Jiri Kosina , Jiri Olsa , Joe Lawrence , John Fastabend , Josh Poimboeuf , Juergen Gross , Juri Lelli , KP Singh , Mark Rutland , Martin KaFai Lau , Martin Liska , Masahiro Yamada , Mel Gorman , Miguel Ojeda , Michal Marek , Miroslav Benes , Namhyung Kim , Nick Desaulniers , Oleksandr Tyshchenko , Petr Mladek , "Rafael J. Wysocki" , Richard Biener , Sedat Dilek , Song Liu , Stanislav Fomichev , Stefano Stabellini , Steven Rostedt , Thomas Gleixner , Valentin Schneider , Vincent Guittot , Vincenzo Frascino , Viresh Kumar , VMware PV-Drivers Reviewers , Yonghong Song Subject: Re: [PATCH 00/46] gcc-LTO support for the kernel In-Reply-To: Message-ID: References: <20221114114344.18650-1-jirislaby@kernel.org> User-Agent: Alpine 2.22 (LSU 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS 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, 17 Nov 2022, Peter Zijlstra wrote: > On Mon, Nov 14, 2022 at 08:40:50PM +0100, Ard Biesheuvel wrote: > > On Mon, 14 Nov 2022 at 12:44, Jiri Slaby (SUSE) wrote: > > > > > > Hi, > > > > > > this is the first call for comments (and kbuild complaints) for this > > > support of gcc (full) LTO in the kernel. Most of the patches come from > > > Andi. Me and Martin rebased them to new kernels and fixed the to-use > > > known issues. Also I updated most of the commit logs and reordered the > > > patches to groups of patches with similar intent. > > > > > > The very first patch comes from Alexander and is pending on some x86 > > > queue already (I believe). I am attaching it only for completeness. > > > Without that, the kernel does not boot (LTO reorders a lot). > > > > > > In our measurements, the performance differences are negligible. > > > > > > The kernel is bigger with gcc LTO due to more inlining. > > > > OK, so if I understand this correctly: > > - the performance is the same > > - the resulting image is bigger > > - we need a whole lot of ugly hacks to placate the linker. > > > > Pardon my cynicism, but this cover letter does not mention any > > advantages of LTO, so what is the point of all of this? > > Seconded; I really hate all the ugly required for the GCC-LTO > 'solution'. There not actually being any benefit just makes it a very > simple decision to drop all these patches on the floor. I'd say that instead a prerequesite for the series would be to actually enforce hidden visibility for everything not part of the kernel module API so the compiler can throw away unused functions. Currently it has to keep everything because with a shared object there might be external references to everything exported from individual TUs. There was a size benefit mentioned for module-less monolithic kernels as likely used in embedded setups, not sure if that's enough motivation to properly annotate symbols with visibility - and as far as I understand all these 'required' are actually such fixes. Richard.