Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2476043rdb; Fri, 8 Dec 2023 09:09:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IH4G1JiH3TS+93T7BU+uj3LExlqaLtdZ+xOBxxcBb8GgOgoxl0CSa+5GIiVxI8i0zddRTcn X-Received: by 2002:a17:902:ea11:b0:1d1:cdd8:61ae with SMTP id s17-20020a170902ea1100b001d1cdd861aemr330167plg.102.1702055367146; Fri, 08 Dec 2023 09:09:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702055367; cv=none; d=google.com; s=arc-20160816; b=dbgffl7PqJZYC2gAGp3lW/y+kwrLNlhqB1v7QCNsgdSgUjhWrd+0C8htOsmRZPPvY0 RZhDYhYNh8tjwZXxbKk/9V4EephoKmx1MDkyzavBTvj/f7m7JOrUgugi2AOP/o1NMGjH 7bLCKgFx9QUSJXHek2ZktswfcAjFY3Pl/Mtu5bSxQsF5lvJiTpRVOkbwLfJAJfr21lP6 vP6R7qx1R+pQEGgti1xMV7uxyQSJ0NadNyO788kGeHuQBWv5IDSkjbzYWUms8NNfQm0q 4VmtfRkUxjNDbiOtKW33dDkPX2CAH3KQh3FkpCzEYE94EraA5be71R1l9gaSNQEsYG+y hdOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Fl/DbN6PDteqBCGQ9SFUZrBoBUM3+MnvMlGzJ2oRlWc=; fh=OEpYSqFTmlJpL3AqD76+oyc+z2UaeY/9hbaQ/kXi0N8=; b=GZ45c8FYYjodTtVxR/xZKs3icc0aXIEYGMGLPaIR152UJb4gA15MwqeuY3jAVzBVrb Dc4WQGBPL+CiOEOVKGmKjt6GwGTj1CIsnoP9uRnpTxKt120hQj9NnJ4prcEPUvB4Zki/ wGgWoYv0Lu3nfFcCj51Sinad90MC+ksPkDEic/liQviw07415DOHUZ/vpTJsZq20kM4+ ml8CqOgy2qtKQOMaz+oDSu8E4NkIkitHfXuepYggobzGaiZXzei7WZvRfFbIKi6fKaVv t0QdbKKHX3C56JvN/jgsdwaLagmOFeOxdqQn1+XkO3YC4Nj+bAWW04iNVyiey4xNAL3h Du6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=ONs6dyzX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id j15-20020a170903024f00b001d1db5e39absi1862819plh.320.2023.12.08.09.09.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 09:09:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=ONs6dyzX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 5865D8266243; Fri, 8 Dec 2023 09:09:19 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236007AbjLHRJA (ORCPT + 99 others); Fri, 8 Dec 2023 12:09:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1574382AbjLHRI5 (ORCPT ); Fri, 8 Dec 2023 12:08:57 -0500 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61C1B199F for ; Fri, 8 Dec 2023 09:09:03 -0800 (PST) Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-40c09d0b045so26770875e9.0 for ; Fri, 08 Dec 2023 09:09:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1702055342; x=1702660142; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Fl/DbN6PDteqBCGQ9SFUZrBoBUM3+MnvMlGzJ2oRlWc=; b=ONs6dyzXBrS2AgfPXz7Wapyl+fljixPVb1qHAtkf8G502cZ6qgPZVGjxq5ifLGHzT6 7pNcGPNTV0dZrkVI5RbIjPBjlBhOHacc8v9Qdg71gmuK27bjPEbtR22OumupL4Jm2y+o k3Nmi3SMHgmdHQSrzYtyEjJUYSlW+AkpOuWrC7XR+u0eySwupG4XNcdC2rgx+4d6+sXx 66FAuWXokvwRuXHuD0vNPkK7Mw0QJ2VtHtRYxg1st0wMPNexWYPy0vOyZ0tlC+Gr18Zx 0eAJewCSGWJcWFZqW7q+dmJ8nm9qxLWHZmyY+VjD7yI9CDPDti7vt1PrMYsM5AE9z9us Z/BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702055342; x=1702660142; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Fl/DbN6PDteqBCGQ9SFUZrBoBUM3+MnvMlGzJ2oRlWc=; b=f22iydfdPVKT4wO6wT2e0N79l3OUbQygqxAPKsmGx07jTswXLajB1wn/mZT3V3Yg1y s8/1ABG89vw8rOtasUYN2mFY2vBWpqQLeCnOGr1uAue7WILsOUvmzBXgeCiiizlpKN+K M/pm2eAanxvD1oLFv7YMy7O22ZYy+G+5zV2oCgyrrjrnKrMY0cMZ/2T3QHQwO7VPfJ9D 7Az4Vk+6MoVtw5/RWtfkZLqdfuS8T0n0s60CA7JtCOeS4xOrcwngkP0Zm3ZQLO60cbNz PHqydM954rI3eP6/5OOBtud4IysNeSmcg0iNm/DCdOcKTvJ1Yiqnxbs8lL731Qn8ytx8 itiw== X-Gm-Message-State: AOJu0YxobbcXEsfM/05ekC0cXvSHF8/pQ0HnNCbnQ/TYCWEj7XcRDYaz J1l4RaESYjNO5LneWSfGnQ2vFc5zsMv/zSrH9gCwiA== X-Received: by 2002:a05:600c:3093:b0:40b:5433:17ef with SMTP id g19-20020a05600c309300b0040b543317efmr118377wmn.30.1702055341613; Fri, 08 Dec 2023 09:09:01 -0800 (PST) MIME-Version: 1.0 References: <20231129-alice-file-v1-0-f81afe8c7261@google.com> <20231129-alice-file-v1-5-f81afe8c7261@google.com> <20231129-etappen-knapp-08e2e3af539f@brauner> <20231129164815.GI23596@noisy.programming.kicks-ass.net> <20231130-wohle-einfuhr-1708e9c3e596@brauner> In-Reply-To: From: Nick Desaulniers Date: Fri, 8 Dec 2023 09:08:47 -0800 Message-ID: Subject: Re: [PATCH 5/7] rust: file: add `Kuid` wrapper To: Miguel Ojeda Cc: comex , Christian Brauner , Peter Zijlstra , Alice Ryhl , Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alexander Viro , Greg Kroah-Hartman , =?UTF-8?B?QXJ2ZSBIasO4bm5ldsOlZw==?= , Todd Kjos , Martijn Coenen , Joel Fernandes , Carlos Llamas , Suren Baghdasaryan , Dan Williams , Kees Cook , Matthew Wilcox , Thomas Gleixner , Daniel Xu , linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-fsdevel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Fri, 08 Dec 2023 09:09:19 -0800 (PST) On Fri, Dec 8, 2023 at 8:19=E2=80=AFAM Miguel Ojeda wrote: > > On Fri, Dec 8, 2023 at 6:28=E2=80=AFAM comex wrote: > > > > Regarding the issue of wrappers not being inlined, it's possible to get= LLVM to optimize C and Rust code together into an object file, with the he= lp of a compatible Clang and LLD: > > > > @ rustc -O --emit llvm-bc a.rs > > @ clang --target=3Dx86_64-unknown-linux-gnu -O2 -c -emit-llvm -o b.bc b= .c > > @ ld.lld -r -o c.o a.bc b.bc > > > > Basically LTO but within the scope of a single object file. This would= be redundant in cases where kernel-wide LTO is enabled. > > > > Using this approach might slow down compilation a bit due to needing to= pass the LLVM bitcode between multiple commands, but probably not very muc= h. > > > > Just chiming in as someone not involved in Rust for Linux but familiar = with these tools. Perhaps this has been considered before and rejected for= some reason; I wouldn=E2=80=99t know. > > Thanks comex for chiming in, much appreciated. > > Yeah, this is what we have been calling the "local-LTO hack" and it > was one of the possibilities we were considering for non-LTO kernel > builds for performance reasons originally. I don't recall who > originally suggested it in one of our meetings (Gary or Bj=C3=B6rn > perhaps). > > If LLVM folks think LLVM-wise nothing will break, then we are happy to On paper, nothing comes to mind. No promises though. From a build system perspective, I'd rather just point users towards LTO if they have this concern. We support full and thin lto. This proposal would add a third variant for just rust drivers. Each variation on LTO has a maintenance cost and each have had their own distinct fun bugs in the past. Not sure an additional variant is worth the maintenance cost, even if it's technically feasible. > go ahead with that (since it also solves the performance side), but it > would be nice to know if it will always be OK to build like that, i.e. > I think Andreas actually tried it and it seemed to work and boot, but > the worry is whether there is something subtle that could have bad > codegen in the future. > > (We will also need to worry about GCC.) > > Cheers, > Miguel --=20 Thanks, ~Nick Desaulniers