rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kunwu Chan <kunwu.chan@linux.dev>
To: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
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 <kunwu.chan@hotmail.com>,
	Grace Deng <Grace.Deng006@gmail.com>
Subject: Re: [PATCH v2] rust: sync: optimize rust symbol generation for CondVar
Date: Tue, 25 Mar 2025 11:01:45 +0800	[thread overview]
Message-ID: <52e7d34e-cf86-40d6-a294-b318df98d72a@linux.dev> (raw)
In-Reply-To: <CANiq72=KjT8HRJA0NStHeqm-9286gay496CU8edNALPQ9_N+ww@mail.gmail.com>

On 2025/3/24 17:37, Miguel Ojeda wrote:
> On Mon, Mar 24, 2025 at 7:19 AM Kunwu Chan<kunwu.chan@linux.dev> wrote:
>> Link:https://github.com/Rust-for-Linux/linux/issues/1145
>> Suggested-by: Alice Ryhl<aliceryhl@google.com>
> 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)


  parent reply	other threads:[~2025-03-25  3:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-24  6:18 [PATCH v2] rust: sync: optimize rust symbol generation for CondVar Kunwu Chan
2025-03-24  9:37 ` Miguel Ojeda
2025-03-24 16:49   ` Boqun Feng
2025-03-25  3:01   ` Kunwu Chan [this message]
2025-03-25 10:12     ` Miguel Ojeda
2025-03-26  1:48       ` Kunwu Chan
2025-04-22 14:25 ` Boqun Feng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52e7d34e-cf86-40d6-a294-b318df98d72a@linux.dev \
    --to=kunwu.chan@linux.dev \
    --cc=Grace.Deng006@gmail.com \
    --cc=a.hindborg@kernel.org \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=benno.lossin@proton.me \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dakr@kernel.org \
    --cc=gary@garyguo.net \
    --cc=justinstitt@google.com \
    --cc=kunwu.chan@hotmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --cc=morbo@google.com \
    --cc=nathan@kernel.org \
    --cc=nick.desaulniers+lkml@gmail.com \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tmgross@umich.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).