Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp722596pxv; Fri, 9 Jul 2021 07:36:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoxT44vX/DvGL4GY+Wnj8S1jLgcL8stjYa8YGFvp5vdNTp+DlDp9ypn8diLayy7ZU/8qZw X-Received: by 2002:a17:906:f294:: with SMTP id gu20mr244581ejb.292.1625841369855; Fri, 09 Jul 2021 07:36:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625841369; cv=none; d=google.com; s=arc-20160816; b=O8mdjVuP7B57fxk9lvPdcRvPaEArrOJqbRVVKakAWX+1d7mxi54gfKjuAStUnbYHNr WGTqXOq3lWgDNQSRcOg0ksT74VWM1idBb75KwozDwjvdNubw6PtcHHjG+WbLLhALl4Aj aX+QDY5mB2Gtm9/Fj38Dt4UgqvcEW4aBxtqK5NwlWf7soJMc/oSBRifrV3bDvZ3zuh/B x/RynTfKR3cLphpBUokvOFIQG5YfphfQ1LyEcnrFhwOn5GWOECowPjLYEvWH8qF888aP 1ombpEAtsb3Pay9zpsEsjDV5aKl4nrzP7reRHt99ziJeEeDrsu06bxX478ALezSPnKqe 4pbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=9iI9BBIN5ChfEI3FnxPdXxRRh4SsTOQ85Lm4ab50ZgU=; b=qJJ3wxSL/FB+YpxfWie4xyCuph+DqSKPgUbDPCa2gqkuaKw0Nklqm1e3lpuuAXU0vs zWaC4u5iSXbsLyeVrjn4g3M1fsIiz/2T3vhXrtkb8pxIVfQMEEic2SCIkyCnYKIeCJ8K +axI2z+uh6/9myveZoeww49S8pwmceqjfVk6fANBVOWGLqSLMpOXnbQKroBuph8KTCW+ CQVDfMgPfje9cNTIo9GBq3iyKeblhJSey/Y8OcVt3x3pQWYdrdyOvryx4dYf1HU/VmPy FWnJFC3RFfCOKwtWcgjfJ9RAgs2QGJZC80hNTeaJtqo4oJLJeXATLQhjZwXF1QiCBUul zyYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qTdTyUG2; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t23si7973667ejs.626.2021.07.09.07.35.46; Fri, 09 Jul 2021 07:36:09 -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=@gmail.com header.s=20161025 header.b=qTdTyUG2; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231963AbhGIOfX (ORCPT + 99 others); Fri, 9 Jul 2021 10:35:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231622AbhGIOfW (ORCPT ); Fri, 9 Jul 2021 10:35:22 -0400 Received: from mail-io1-xd35.google.com (mail-io1-xd35.google.com [IPv6:2607:f8b0:4864:20::d35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A6EEC0613DD; Fri, 9 Jul 2021 07:32:39 -0700 (PDT) Received: by mail-io1-xd35.google.com with SMTP id y8so12595478iop.13; Fri, 09 Jul 2021 07:32:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9iI9BBIN5ChfEI3FnxPdXxRRh4SsTOQ85Lm4ab50ZgU=; b=qTdTyUG2DaXjYQnvicuCU4wXgYVOIsZZ/gTmsMhPyGAYSSbCmQze7jcXn1myhKDH/E TLnHapoaZv0JcSyWRb7pvTNAsL4xhbhsohPMTufJJlsn6p+suF+fJfWtJkIUhJj5VfLR eKB/cVmq8UJroy6uZNOukKxKq8WjW7NYpF2zWeW91YAs5vzrOIHLvxaGqAGaTURQ/i0a xiZ1/ZwV+TUysnyvCa4VMkkFjlEP0WbT5GpcGD/caX3OzazowH55A3ptBc7o3m6X35aR rTt0o9TEv0J5+7cf2/QprWB2VWGA0lZxCLGlb6YQGIA+oM1LnNzu+y7I228AvUIterk/ IAEQ== 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=9iI9BBIN5ChfEI3FnxPdXxRRh4SsTOQ85Lm4ab50ZgU=; b=h+bb+Y2ty98VFt8SmxZgVjJGEPIUOIW4mXlTCPpQLmk3joyzARYf+f2/ZQzirJIQ+K I8pkM8Y2BtgHfxmoCBF2r0YWE1K9nbX8YJv1GX1DgczkfhGPTlwcEpPlDnaagE8dJoyD XDjbAC/WX6W9pyF0zxr+u8fGEsev2tPBzX7wUxLX+SJBIUomCsNVszJHtTcSgoQnfUcW zqy/qhEPcSsMDW5a0YCL9XgDpcHf6L3WFykh4VCHbmjgULEsJJG3NbcjOnvaFlp2OmuX UM0Tmh7iZEEv6vUAqXO32GHwyCdJSK5VuwQG544+h/nEt3w1aEUBxruG6TY9C3Vhr7OH E5bg== X-Gm-Message-State: AOAM531lic+BRvw6C/SYvn8YeXN6TZ0rSGiLN/z+JtaVXIrHBWUp/qXl TZz6LXjeHDO8yatE6a3Nhfv7bNmuQ/e3WkpxzuVzIARc0hEQ0A== X-Received: by 2002:a02:a310:: with SMTP id q16mr33022208jai.8.1625841158612; Fri, 09 Jul 2021 07:32:38 -0700 (PDT) MIME-Version: 1.0 References: <20210704202756.29107-1-ojeda@kernel.org> <20210704202756.29107-6-ojeda@kernel.org> In-Reply-To: From: Miguel Ojeda Date: Fri, 9 Jul 2021 16:32:27 +0200 Message-ID: Subject: Re: [PATCH 05/17] rust: add C helpers To: Marco Elver Cc: Miguel Ojeda , Linus Torvalds , Greg Kroah-Hartman , rust-for-linux , Linux Kbuild mailing list , Linux Doc Mailing List , linux-kernel , Alex Gaynor , Geoffrey Thomas , Finn Behrens , Adam Bratschi-Kaye , Wedson Almeida Filho , Boqun Feng , Sumera Priyadarsini , Michael Ellerman , Sven Van Asbroeck , Gary Guo , Boris-Chengbiao Zhou , Fox Chen , Ayaan Zaidi , Douglas Su , Yuki Okushi , clang-built-linux Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 7, 2021 at 12:19 PM 'Marco Elver' via Clang Built Linux wrote: > > What is the story with Rust and LTO? Intuitively, I would expect Rust > code to only perform optimally if the kernel is built with LTO > (currently only supported via Clang). Cross-language LTO is possible and is used in other major projects. For instance, Firefox seems to use it: https://bugzilla.mozilla.org/show_bug.cgi?id=1486042 However, we have not taken a look at it yet for the kernel. > Because if calls to every one of these helpers are real calls, I would > expect performance to be pretty poor. There's probably a reason these > are macros or inlinable functions. Maybe -- we need to measure. > I would almost go so far and suggest that CONFIG_RUST be modified as > follows: Even if the performance was unacceptable, there are other ways than LTO to solve this, such as implementing the equivalent macro/function on Rust's side. Furthermore, we need to consider GCC too. Thus I would not be premature in making it depend on LTO. Cheers, Miguel