From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-170.mta1.migadu.com (out-170.mta1.migadu.com [95.215.58.170]) (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 1F3611494D8 for ; Tue, 25 Mar 2025 03:02:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742871774; cv=none; b=PZW1ahPfiXMwsy3TvXhO2w76lZmKOu21j3DGPlw8AuTXfTtay7h0rv3Iw9qt5V38gsD1T3aYJB2zraIAs0QKzDVmrgZibOL/4Opm6qakB1GVWUIeVxbR/8CVuBBKX2XIzZxFGj9D0BvbFC5YYxy0In2sQVZhyCo1nFzRRe7LqZA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742871774; c=relaxed/simple; bh=p+6PwRCtOXKT7ZJv96aTDIh/LRMyr3o7sI/Y1/kJn5I=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References: In-Reply-To:Content-Type; b=ChUSmaDdYnlloRwaveQkRvY6pDojhNkdrcqQqFiU6RsEOZqEqHpiTZIGz+yoRLB7vDaoRmUHJZpKkeW0K9OvlN1ky6FMpEEJZrUmYp+yPt92lApGnzLX75mt+f+xKZ4LOqP6iSvseejj6YgjmoYFX5sAS/BERp5xfaEMs8k2PLI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=PUu+TYpj; arc=none smtp.client-ip=95.215.58.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="PUu+TYpj" Message-ID: <52e7d34e-cf86-40d6-a294-b318df98d72a@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1742871760; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IGGsd72H09Ek4y5Nasx3ldah0+WIfjmF4R9A3El2Gqs=; b=PUu+TYpjV89j/VYrhe12ry4OhxeGSCw5aIZ3H1/JBah4h8SPGbDBX7xlgwnNaSRF5bdnYw Ex9q8FoYlmI6FH0MWym2+K6fCdyFdznFmZChjy6qVGWvCS80saUwOh3nqhlOa2H05nGVua /ha1F1sMacAizT5OrurYNI8iWw7xMGc= Date: Tue, 25 Mar 2025 11:01:45 +0800 Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kunwu Chan Subject: Re: [PATCH v2] rust: sync: optimize rust symbol generation for CondVar To: Miguel Ojeda Cc: ojeda@kernel.org, alex.gaynor@gmail.com, boqun.feng@gmail.com, gary@garyguo.net, bjorn3_gh@protonmail.com, benno.lossin@proton.me, a.hindborg@kernel.org, aliceryhl@google.com, tmgross@umich.edu, dakr@kernel.org, nathan@kernel.org, nick.desaulniers+lkml@gmail.com, morbo@google.com, justinstitt@google.com, rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Kunwu Chan , Grace Deng References: <20250324061835.1693125-1-kunwu.chan@linux.dev> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT On 2025/3/24 17:37, Miguel Ojeda wrote: > On Mon, Mar 24, 2025 at 7:19 AM Kunwu Chan wrote: >> Link:https://github.com/Rust-for-Linux/linux/issues/1145 >> Suggested-by: Alice Ryhl > Nit: I typically use Link after Suggested-by, to mimic what the docs > require about Reported-by with Link. (No need to resend a new version > just for this :) Thanks for the kind reminder, I'll follow this next time >> - Remove '#[inline]' for notify() > It is good that the commit matches the log now, though I wonder if in > the future we may want the `#[inline]` for `notify` anyway, even if > LLVM does that one on its own today. Now, the default '-Copt-level' is 2 when define 'CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE', and in  KBUILD_RUSTFLAGS the  '-Ccodegen-units' is 1. So if the config not change, the result should be the same. And the actualy compile steps for rust/kernel.o is as following: make -f ./scripts/Makefile.build obj=rust # RUSTC L rust/kernel.o OBJTREE=/media/kunwuchan/68d922f3-5dde-45b0-af93-c45ba81d85ef/linux-next rustc --edition=2021 -Zbinary_dep_depinfo=y -Astable_features -Dnon_ascii_idents -Dunsafe_op_in_unsafe_fn -Wmissing_docs -Wrust_2018_idioms -Wunreachable_pub -Wclippy::all -Wclippy::ignored_unit_patterns -Wclippy::mut_mut -Wclippy::needless_bitwise_bool -Wclippy::needless_continue -Aclippy::needless_lifetimes -Wclippy::no_mangle_with_rust_abi -Wclippy::undocumented_unsafe_blocks -Wclippy::unnecessary_safety_comment -Wclippy::unnecessary_safety_doc -Wrustdoc::missing_crate_level_docs -Wrustdoc::unescaped_backticks -Cpanic=abort -Cembed-bitcode=n -Clto=n -Cforce-unwind-tables=n -Ccodegen-units=1 -Csymbol-mangling-version=v0 -Crelocation-model=static -Zfunction-sections=n -Wclippy::float_arithmetic --target=aarch64-unknown-none-softfloat -Cforce-unwind-tables=n -Zbranch-protection=bti,pac-ret -Copt-level=2 -Cdebug-assertions=y -Coverflow-checks=y -Cforce-frame-pointers=y -Cdebuginfo=1 @./include/generated/rustc_cfg --extern ffi --extern pin_init --extern build_error --extern macros --extern bindings --extern uapi --emit=dep-info=rust/.kernel.o.d --emit=obj=rust/kernel.o --emit=metadata=rust/libkernel.rmeta --crate-type rlib -L./rust --crate-name kernel rust/kernel/lib.rs --sysroot=/dev/null # EXPORTS rust/exports_kernel_generated.h   llvm-nm -p --defined-only rust/kernel.o | awk '$2~/(T|R|D|B)/ && $3!~/__cfi/ && $3!~/__odr_asan/ { printf "EXPORT_SYMBOL_RUST_GPL(%s); ",$3 }' > rust/exports_kernel_generated.h > Cheers, > Miguel -- Thanks, Kunwu.Chan(Tao.Chan)