From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 695431E5B64; Sun, 1 Mar 2026 19:59:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772395191; cv=none; b=P1pRDfaZPpaTxX6VbsHe+61c0dS/3JeRHCzv/HOLUoYwXQkhTW2MNbXV4J9bbI6rS0NUmNQCwyQsFNSwbkmBtaHP0Hp5YodK8lvYpJ/6Qqobvnes9jgbMPG3taRnNAZl/Bp7sVkgBrEjfuVjcA2MxR7mT8E87rPj9DY+If344sI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772395191; c=relaxed/simple; bh=c7Lf0pg//jvb+3j7ibNw1PDnDJENzEb1R7UG7EkUWBo=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=DTG20OkN5GQJOGWw8iRr4vNdaA+nkz/sPVCtS9t2U6OiLHr+3JU7XSi04VQ6sw6YAFhYPPJkSIOagD7ace4pXvah7Ad8cnf0rKpFHTJ6VdP3bz6hwr3sNr05PZ42pfkh+/3MmmR6cibArpmBFttt7JTfvT2kBoywhnXZyNwJaN0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Bu1SLlPE; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Bu1SLlPE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 93A73C116C6; Sun, 1 Mar 2026 19:59:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772395191; bh=c7Lf0pg//jvb+3j7ibNw1PDnDJENzEb1R7UG7EkUWBo=; h=Date:Cc:Subject:From:To:References:In-Reply-To:From; b=Bu1SLlPExanZzJBk/3KZ/KJEQNSweZ38bl1tkZtVFxhnq0oJlUvJegoCFn4bRC5Uz 8JDJaAmHXk5dhybtqUAV/W3yC/U52oInYwdv69V1GK+nnTYouG94WW/x7Xw8lxDOZW NLQl7cIpj6VKUwwEwSu3f2J+rajFU7zgPKfetnELrePj1Nlrv58tgQA8w7IEJTypc8 IkJhPuewEYoACBnMZr2n7CuzKUSdrgsOeKZ16KgdW5hPuSMIlSi+farv4EpkH6PCj9 YYCQdHxF61C67tz1eYO2FCji1QDBfhLkU34F5H3EpcsZm3OxSXvAcfEcGrmjaGYIaG zXQ1ANgq2n3QQ== Precedence: bulk X-Mailing-List: linux-security-module@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Sun, 01 Mar 2026 20:59:41 +0100 Message-Id: Cc: , , , , , , , , Subject: Re: [PATCH v16 01/10] rust: alloc: add `KBox::into_nonnull` From: "Benno Lossin" To: "Gary Guo" , "Andreas Hindborg" , "Miguel Ojeda" , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , "Alice Ryhl" , "Trevor Gross" , "Danilo Krummrich" , "Greg Kroah-Hartman" , "Dave Ertman" , "Ira Weiny" , "Leon Romanovsky" , "Paul Moore" , "Serge Hallyn" , "Rafael J. Wysocki" , "David Airlie" , "Simona Vetter" , "Alexander Viro" , "Christian Brauner" , "Jan Kara" , "Igor Korotin" , "Daniel Almeida" , "Lorenzo Stoakes" , "Liam R. Howlett" , "Viresh Kumar" , "Nishanth Menon" , "Stephen Boyd" , "Bjorn Helgaas" , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , "Boqun Feng" , "Vlastimil Babka" , "Uladzislau Rezki" X-Mailer: aerc 0.21.0 References: <20260224-unique-ref-v16-0-c21afcb118d3@kernel.org> <20260224-unique-ref-v16-1-c21afcb118d3@kernel.org> <87ldgbbjal.fsf@t14s.mail-host-address-is-not-set> In-Reply-To: On Sun Mar 1, 2026 at 8:25 PM CET, Gary Guo wrote: > `#[inline]` is a hint to make it more likely for compilers to inline. Wit= hout > them, you're relying on compiler heurstics only. There're cases (especial= ly with > abstractions) where the function may look complex as it contains lots of > function calls (so compiler heurstics avoid inlining them), but they're a= ll > zero-cost abstractions so eventually things get optimized away. > > For non-generic functions, there is additional issue where only very smal= l > functions get automatically inlined, otherwise a single copy is generated= at the > defining crate and compiler run on a dependant crate has no chance to eve= n peek > what's in the function. > > If you know a function should be inlined, it's better to just mark them a= s such, > so there're no surprises. Should we set clippy::missing_inline_in_public_items [1] to "warn"? [1]: https://rust-lang.github.io/rust-clippy/master/index.html?search=3Dmis= sing_inline_in_public_items Cheers, Benno