Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2593096rdb; Fri, 8 Dec 2023 12:43:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IEbZZQtqB7gk/jwiA72u22p32RK5PKFJlBxmd2TuJLrTKlqATpOnbDBqEOic/Qxz5sye+SW X-Received: by 2002:a05:6a20:12c7:b0:18a:fbd1:8e6d with SMTP id v7-20020a056a2012c700b0018afbd18e6dmr581053pzg.27.1702068236041; Fri, 08 Dec 2023 12:43:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702068236; cv=none; d=google.com; s=arc-20160816; b=rQsvmvoFmw2E6aw18ftzwVfzKU/HMtUzH9T3Pvd7AbUWhV9bUhlCrwBeRN/AUDfjUb ITs10QpN8NYePelmC4OkU7e0kEcxq4ADUHG7ixIwftOSkCTuleBdCE/Uqeqtk3kABMWX 5t1mZaLwep5/GZ2OPM2iW9FNU4eOI5v3It3Rp/Kl2XtoVQD8M/FOkUY0khhN7f2HaX23 G9pfj9QsrVChu5fV4W/re/RH+6Y/7ysid0gYAzpVZQGKe3rhZ6/d56O4TAreEnbdR6fV yOAEKPuv6H+LpAzvlc6YV+fwYA6be69m3j6e+pXE60KhzboSiABTZdnrRhlpKEnsRGb1 gbKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=8vLlP+pPcWW01QzZqjgtBbIIyAPwFK9O42/VsZGzF5E=; fh=J3dfDVwXE+YHbJxdP+NJeK3LwiIRt5KUhDK+TI6wu9g=; b=XMI81PMLCvyP9ITgrxfFp9J9jF0GImB22ba0QqM/IMjI2Cc/U+f+MlPC3RBkdDivKt MtuBH1RqczVKyVzG/Vor0DoFOy3QeAa1wb00NR9gewhqv4GeND33gDGcWkaz4lXW1vkr /AKtTnpv+98+9EY82WVEKWfvtKmH7x0KLt1IaORGuzs0Pk4zba7F7rer4U/51h2bPqA3 3+wAHyVewbT4m52IIp3fXWbl6Qw6wMVTPHaf/X3dudtmcQoDEhz6B1TpYgscQkpV2ITJ YUqDycW8KrhQdZSrUJ5paP2rWRunipos8lCf1Sn7hBmRpeZ9n4q45WLkQKf6nknP2L35 1EVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Yhg3URpG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id x9-20020a056a00188900b006cda14566f1si2015196pfh.150.2023.12.08.12.43.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 12:43:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Yhg3URpG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 7B5C68106783; Fri, 8 Dec 2023 12:43:54 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233919AbjLHUno (ORCPT + 99 others); Fri, 8 Dec 2023 15:43:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229913AbjLHUnn (ORCPT ); Fri, 8 Dec 2023 15:43:43 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD93A1724; Fri, 8 Dec 2023 12:43:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=8vLlP+pPcWW01QzZqjgtBbIIyAPwFK9O42/VsZGzF5E=; b=Yhg3URpGhmhc5v8U/fS6J/06Tc NKkDkeLBjoflzM+RHIJ19vp4D2e2zYXjBM626AEQ7Pswgbyj9yD6vcItTar1poSe0tZ/OIGo+o+fv URe4Em6k2Qzh11KOd4VF1+RB5ZVW8wWBC0XDkFBy0+6vyvD0+Qrt54n11/k6XDeXn8sCACK+/48GS i7jF1YJ3Bgoku6oytM/hrRZPXNg7dBCVnSTBwfuHdyJShWWgCVyUVhapbY3wz4V0OtOetMdQYpA/Z oIQeHxbq1kh7w+OfJt2KzYxUH5U0mU66GhZwxVS3JjLqGe1eFlcn1PeNt5j6MTFV8YQeVIJRDR5Jo Suaz3aRg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1rBhh1-006Xz9-Df; Fri, 08 Dec 2023 20:43:27 +0000 Date: Fri, 8 Dec 2023 20:43:27 +0000 From: Matthew Wilcox To: Nick Desaulniers Cc: Miguel Ojeda , comex , Christian Brauner , Peter Zijlstra , Alice Ryhl , Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , Andreas Hindborg , Alexander Viro , Greg Kroah-Hartman , Arve =?iso-8859-1?B?SGr4bm5lduVn?= , Todd Kjos , Martijn Coenen , Joel Fernandes , Carlos Llamas , Suren Baghdasaryan , Dan Williams , Kees Cook , Thomas Gleixner , Daniel Xu , linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH 5/7] rust: file: add `Kuid` wrapper 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 08 Dec 2023 12:43:54 -0800 (PST) On Fri, Dec 08, 2023 at 09:08:47AM -0800, Nick Desaulniers wrote: > 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. If we're allowed to talk about ideal solutions ... I hate putting code in header files. I'd rather be able to put, eg: __force_inline int put_page_testzero(struct page *page) { VM_BUG_ON_PAGE(page_ref_count(page) == 0, page); return page_ref_dec_and_test(page); } __force_inline int folio_put_testzero(struct folio *folio) { return put_page_testzero(&folio->page); } __force_inline void folio_put(struct folio *folio) { if (folio_put_testzero(folio)) __folio_put(folio); } into a .c file and have both C and Rust inline folio_put(), folio_put_testzero(), put_page_testzero(), VM_BUG_ON_PAGE() and page_ref_dec_and_test(), but not even attempt to inline __folio_put() (because We Know Better, and have determined that is the point at which to stop).