Rust for Linux List
 help / color / mirror / Atom feed
From: Boqun Feng <boqun.feng@gmail.com>
To: FUJITA Tomonori <fujita.tomonori@gmail.com>
Cc: linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org,
	ojeda@kernel.org, alex.gaynor@gmail.com, gary@garyguo.net,
	bjorn3_gh@protonmail.com, benno.lossin@proton.me,
	a.hindborg@samsung.com, aliceryhl@google.com, tmgross@umich.edu,
	dakr@kernel.org, mingo@redhat.com, peterz@infradead.org,
	juri.lelli@redhat.com, vincent.guittot@linaro.org,
	dietmar.eggemann@arm.com, rostedt@goodmis.org,
	bsegall@google.com, mgorman@suse.de, vschneid@redhat.com,
	pmladek@suse.com
Subject: Re: [PATCH v2 0/2] add Rust version of might_sleep()
Date: Tue, 22 Apr 2025 07:30:05 -0700	[thread overview]
Message-ID: <aAen7fQYciq2azi9@Mac.home> (raw)
In-Reply-To: <20250410225623.152616-1-fujita.tomonori@gmail.com>

On Fri, Apr 11, 2025 at 07:56:21AM +0900, FUJITA Tomonori wrote:
> This patchset adds Rust version of might_sleep().
> 
> These patches were previously part of the IO polling patchset [1], but
> they were split out to make upstreaming easier.
> 
> The first patch is for sched/core, which adds
> __might_sleep_precision(), rust friendly version of __might_sleep(),
> which takes a pointer to a string with the length instead of a
> null-terminated string. Rust's core::panic::Location::file(), which
> gives the file name of a caller, doesn't provide a null-terminated
> string. __might_sleep_precision() uses a precision specifier in the
> printk format, which specifies the length of a string; a string
> doesn't need to be a null-terminated. Providing a null-terminated
> string for better C interoperability is under discussion [2].
> 
> The second patch adds a Rust implementation of might_sleep(), on top
> of the changes in the first patch.
> 
> [1]: https://lore.kernel.org/lkml/20250220070611.214262-1-fujita.tomonori@gmail.com/
> [2]: https://github.com/rust-lang/libs-team/issues/466
> 
> v2:
> - improve SAFETY comment
> v1: https://lore.kernel.org/lkml/20250406110718.126146-1-fujita.tomonori@gmail.com/
> 

@scheduler, if there is no objection, I'm going to take these two into a
pull request to tip soon. Thanks!

Regards,
Boqun

> FUJITA Tomonori (2):
>   sched/core: Add __might_sleep_precision()
>   rust: task: add Rust version of might_sleep()
> 
>  include/linux/kernel.h |  2 ++
>  kernel/sched/core.c    | 62 ++++++++++++++++++++++++++++--------------
>  rust/helpers/task.c    |  6 ++++
>  rust/kernel/task.rs    | 28 +++++++++++++++++++
>  4 files changed, 77 insertions(+), 21 deletions(-)
> 
> 
> base-commit: 0af2f6be1b4281385b618cb86ad946eded089ac8
> -- 
> 2.43.0
> 
> 

  parent reply	other threads:[~2025-04-22 14:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-10 22:56 [PATCH v2 0/2] add Rust version of might_sleep() FUJITA Tomonori
2025-04-10 22:56 ` [PATCH v2 1/2] sched/core: Add __might_sleep_precision() FUJITA Tomonori
2025-04-10 22:56 ` [PATCH v2 2/2] rust: task: add Rust version of might_sleep() FUJITA Tomonori
2025-04-11  9:11   ` Alice Ryhl
2025-04-22 14:30 ` Boqun Feng [this message]
2025-04-22 14:31   ` [PATCH v2 0/2] " Peter Zijlstra

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=aAen7fQYciq2azi9@Mac.home \
    --to=boqun.feng@gmail.com \
    --cc=a.hindborg@samsung.com \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=benno.lossin@proton.me \
    --cc=bjorn3_gh@protonmail.com \
    --cc=bsegall@google.com \
    --cc=dakr@kernel.org \
    --cc=dietmar.eggemann@arm.com \
    --cc=fujita.tomonori@gmail.com \
    --cc=gary@garyguo.net \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=ojeda@kernel.org \
    --cc=peterz@infradead.org \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tmgross@umich.edu \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    /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