From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="Yhg3URpG" 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> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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).