Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2130884rdb; Thu, 7 Dec 2023 21:28:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IFxUJvV77lSBYx9g8S1nTPXMAXL7I2ijy6h9D/9xcgV2keE/NM5jdBSUytNfZ3TswZWV9tg X-Received: by 2002:a05:6a00:1345:b0:6ce:4018:a726 with SMTP id k5-20020a056a00134500b006ce4018a726mr4732333pfu.62.1702013314994; Thu, 07 Dec 2023 21:28:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702013314; cv=none; d=google.com; s=arc-20160816; b=qWlze15cW2QjYQOPPZbvQ9Ew9Fa/dxWXiRsXQZHvDJUtjyCMcTc7tQCn3X/1Wzjyk6 tRm9B//hpri3D1oo8DvOWzrvm0WSw9sgQY3PsV37xVZ0632CSHmYJmD6gKcEnIDe5WvB XT6ntOgg3aAbajgUB4KSnEB8JJTfgWk0+f/lUvvw2HVpjU7DvnudfSfSa9KDwC5GhVtU cg+dHxZIQUdGqULjkfwwnIgRZhBKWvdqGTHAmMEtffbU5+iQ9mXEwdrmvtPmVMrGYJln 7sX2lIY/bPOINBvDFNoREDXS4fyOez3zjcXvaDZzyD7YIOqf5GQlPFkEDT9iAXdhtVMl FwMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=dUGmPEbpW20dc17tUbVamxt8gw7gwKEC4FwZ3bTqHfg=; fh=1gUXyr3fPICkKHteIv6fwfloYu9ryfgnqSZ5YY5SRGI=; b=K5l/dcO1RU32FysQlWwl9ZwUOmMMvSBB0/EL4LQSMkWhj/uvgqsoa3vEabYB39tflE jXf3UXed4qslDwk88bti30tYmoGNS2/4wO2gNWJ9An9IdOSLgLJ5yCVdFhT0CT1BQCXO F7DL1iSWC/gh4HPN8kBwGJiSxvrPBqmxTycFnuEi4FDmZ7nN+1dAOcwbKIXVJpZanbz0 H2SFaXdabPfY+SlLPzsqcjw7I80k21MNm9/1vqrHWF1Hdo9dpblK2U3uNehPZg/zJJzR xO125jJ7HDjd0pSQQXBglXXMx5yqMyT8zPkJmT04YCpTHM6aWzJGe6af7zshqthYUYQF xJmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=FStLKhW4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id bs2-20020a632802000000b005c6b59c91bbsi939100pgb.654.2023.12.07.21.28.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 21:28:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=FStLKhW4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id DBA2981067A4; Thu, 7 Dec 2023 21:28:31 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232431AbjLHF2R (ORCPT + 99 others); Fri, 8 Dec 2023 00:28:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229476AbjLHF2P (ORCPT ); Fri, 8 Dec 2023 00:28:15 -0500 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC8CE1708; Thu, 7 Dec 2023 21:28:21 -0800 (PST) Received: by mail-pg1-x535.google.com with SMTP id 41be03b00d2f7-5c66e7eafabso1434024a12.0; Thu, 07 Dec 2023 21:28:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702013301; x=1702618101; darn=vger.kernel.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=dUGmPEbpW20dc17tUbVamxt8gw7gwKEC4FwZ3bTqHfg=; b=FStLKhW4VJO/dzygcS3r4iEzvjZPu+Glw17zY1SWmE5l4ww1ZYBXuPos67/TOjSLZJ ub36WDDJBvMdLCVm1Pst2zY9Swh2LfCt6VmaiqIBqTzj0GdhkSK2YeRTQ3AufuygWNxZ U0BZ5R5ex1ROxdhWh7lu56BV3xwofqbSZeSL6v9gb1SQxELsVhTfPEJFBeqLRrrG9rrQ CPlNoS2/CyxJPr112Wb9jVafzkr8kOksMEgIAfxIIOLAEduEbijSbOhk9VWyWgGbp39q HLscicbWJb0mszy0vPY6OrdsyRVDVQl8EdU8pp5XDNblwHSXAd184AsrylPtAQKs1YSd /HQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702013301; x=1702618101; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dUGmPEbpW20dc17tUbVamxt8gw7gwKEC4FwZ3bTqHfg=; b=LuIavFHaFHYKDNDImX7bauqRFB56DC4YnUSEA3nFEVFx/9OS7Imck3TQ23RmpwbsRx Tjm1eeQESOZkM56eD8UURzeSQTET2lZLwoTUhQiQ3vRTaTVSwFLADnHBUtItfO2/D9Lo sPE5yuTRG5u8ZN/Pe/dQk+bVMRrp2beXsO+OAx3oyQb4lYyLU2Zbbv4SoghTigkL4RDa wqBGoZJ32egD5tD76Vwkg2AP4UE9wFFQgO/sNZZDq5ldis3qH827thhU06s6GeEHTf9q /uzwZJHJq0w/mmKPcxCTbLM33PHJElnSNJI7CeUkqQEf1o8YIhjE85/FiVfjephNgbQY yulA== X-Gm-Message-State: AOJu0YyZi6gxkmztdxunMzQSC+vxEytPZWk3bCz2RDmTlxQUadsvPiS8 VaBJeRkzr1r1AmticoEr6fI= X-Received: by 2002:a17:90b:3b50:b0:286:6cc0:caca with SMTP id ot16-20020a17090b3b5000b002866cc0cacamr3711007pjb.65.1702013301134; Thu, 07 Dec 2023 21:28:21 -0800 (PST) Received: from smtpclient.apple ([2601:647:4b00:6db0:b844:97a8:fed6:b1f7]) by smtp.gmail.com with ESMTPSA id sc1-20020a17090b510100b002867adefbd4sm848049pjb.48.2023.12.07.21.28.18 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Dec 2023 21:28:20 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.300.42\)) Subject: Re: [PATCH 5/7] rust: file: add `Kuid` wrapper From: comex In-Reply-To: <20231130-wohle-einfuhr-1708e9c3e596@brauner> Date: Thu, 7 Dec 2023 21:28:06 -0800 Cc: 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?Q?Arve_Hj=C3=B8nnev=C3=A5g?= , 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-Transfer-Encoding: quoted-printable Message-Id: 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> To: Christian Brauner X-Mailer: Apple Mail (2.3774.300.42) X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.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 (fry.vger.email [0.0.0.0]); Thu, 07 Dec 2023 21:28:32 -0800 (PST) > On Nov 30, 2023, at 4:46=E2=80=AFAM, Christian Brauner = wrote: >=20 > I wouldn't even > complain if it they were somehow auto-generated but as you say that > might be out of scope. FYI, rust-bindgen got an experimental feature of this nature earlier = this year: https://github.com/rust-lang/rust-bindgen/pull/2335 Though apparently it has significant limitations meriting it the = =E2=80=9Cexperimental=E2=80=9D title. 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 = help of a compatible Clang and LLD: @ rustc -O --emit llvm-bc a.rs =20= @ 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 = much. 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.=