* [PATCH 1/2] rust: Add cpumask helpers
2025-02-21 20:56 [PATCH " Yury Norov
@ 2025-02-21 20:56 ` Yury Norov
2025-02-24 8:56 ` Viresh Kumar
0 siblings, 1 reply; 12+ messages in thread
From: Yury Norov @ 2025-02-21 20:56 UTC (permalink / raw)
To: Miguel Ojeda, Viresh Kumar, Danilo Krummrich
Cc: Yury Norov, Rafael J. Wysocki, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
Trevor Gross, Rasmus Villemoes, Vincent Guittot, Stephen Boyd,
Nishanth Menon, Manos Pitsidianakis, Erik Schilling,
Alex Bennée, Joakim Bech, Rob Herring, Christoph Hellwig,
Jason Gunthorpe, John Hubbard, linux-pm, rust-for-linux,
linux-kernel
From: Viresh Kumar <viresh.kumar@linaro.org>
In order to prepare for adding Rust abstractions for cpumask, add
the required helpers for inline cpumask functions that cannot be
called by rust code directly.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Yury Norov [NVIDIA] <yury.norov@gmail.com>
---
Yury: a bit more wording in commit description.
Question: zalloc_cpumask_war() is a convenient wrapper around
alloc_cpumask_var_node(). Maybe rust can use the latter directly as it's
a true outlined function? There's more flexibility, if you need it, but
also a higher risk that the API will change: ~40 users vs 180 for zalloc
thing. Up to you guys. I can send v2 if needed.
rust/bindings/bindings_helper.h | 1 +
rust/helpers/cpumask.c | 40 +++++++++++++++++++++++++++++++++
rust/helpers/helpers.c | 1 +
3 files changed, 42 insertions(+)
create mode 100644 rust/helpers/cpumask.c
diff --git a/rust/bindings/bindings_helper.h b/rust/bindings/bindings_helper.h
index f46cf3bb7069..2396ca1cf8fb 100644
--- a/rust/bindings/bindings_helper.h
+++ b/rust/bindings/bindings_helper.h
@@ -10,6 +10,7 @@
#include <linux/blk-mq.h>
#include <linux/blk_types.h>
#include <linux/blkdev.h>
+#include <linux/cpumask.h>
#include <linux/cred.h>
#include <linux/device/faux.h>
#include <linux/errname.h>
diff --git a/rust/helpers/cpumask.c b/rust/helpers/cpumask.c
new file mode 100644
index 000000000000..df4b1a2853a9
--- /dev/null
+++ b/rust/helpers/cpumask.c
@@ -0,0 +1,40 @@
+// SPDX-License-Identifier: GPL-2.0
+
+#include <linux/cpumask.h>
+
+void rust_helper_cpumask_set_cpu(unsigned int cpu, struct cpumask *dstp)
+{
+ cpumask_set_cpu(cpu, dstp);
+}
+
+void rust_helper_cpumask_clear_cpu(int cpu, struct cpumask *dstp)
+{
+ cpumask_clear_cpu(cpu, dstp);
+}
+
+void rust_helper_cpumask_setall(struct cpumask *dstp)
+{
+ cpumask_setall(dstp);
+}
+
+unsigned int rust_helper_cpumask_weight(struct cpumask *srcp)
+{
+ return cpumask_weight(srcp);
+}
+
+void rust_helper_cpumask_copy(struct cpumask *dstp, const struct cpumask *srcp)
+{
+ cpumask_copy(dstp, srcp);
+}
+
+bool rust_helper_zalloc_cpumask_var(cpumask_var_t *mask, gfp_t flags)
+{
+ return zalloc_cpumask_var(mask, flags);
+}
+
+#ifndef CONFIG_CPUMASK_OFFSTACK
+void rust_helper_free_cpumask_var(cpumask_var_t mask)
+{
+ free_cpumask_var(mask);
+}
+#endif
diff --git a/rust/helpers/helpers.c b/rust/helpers/helpers.c
index 0640b7e115be..de2341cfd917 100644
--- a/rust/helpers/helpers.c
+++ b/rust/helpers/helpers.c
@@ -11,6 +11,7 @@
#include "bug.c"
#include "build_assert.c"
#include "build_bug.c"
+#include "cpumask.c"
#include "cred.c"
#include "device.c"
#include "err.c"
--
2.43.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2] rust: Add cpumask helpers
2025-02-21 20:56 ` [PATCH 1/2] rust: Add cpumask helpers Yury Norov
@ 2025-02-24 8:56 ` Viresh Kumar
2025-02-24 19:40 ` Yury Norov
0 siblings, 1 reply; 12+ messages in thread
From: Viresh Kumar @ 2025-02-24 8:56 UTC (permalink / raw)
To: Yury Norov
Cc: Miguel Ojeda, Danilo Krummrich, Rafael J. Wysocki, Alex Gaynor,
Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Alice Ryhl, Trevor Gross, Rasmus Villemoes,
Vincent Guittot, Stephen Boyd, Nishanth Menon,
Manos Pitsidianakis, Erik Schilling, Alex Bennée,
Joakim Bech, Rob Herring, Christoph Hellwig, Jason Gunthorpe,
John Hubbard, linux-pm, rust-for-linux, linux-kernel
Hi Yury,
On 21-02-25, 15:56, Yury Norov wrote:
> Question: zalloc_cpumask_war() is a convenient wrapper around
> alloc_cpumask_var_node(). Maybe rust can use the latter directly as it's
> a true outlined function? There's more flexibility, if you need it, but
> also a higher risk that the API will change: ~40 users vs 180 for zalloc
> thing. Up to you guys. I can send v2 if needed.
I looked at the APIs again and here is what I feel:
- I am not sure if the Rust code will have any users of the *_node()
APIs in the near future. i.e. There is no need for the Rust code to
implement Cpumask::new_node() version for now.
- I have missed implementing the uninitialized version earlier,
alloc_cpumask_var(), which I think should be implemented right away.
Bindings for alloc_cpumask_var() are required to be added for this
though.
- One advantage of using zalloc_cpumask_var() instead of
alloc_cpumask_var() is that we don't need to open code it in the
Rust code, specifically for the !CONFIG_CPUMASK_OFFSTACK case where
we need to call cpumask_clear() separately.
- The Rust side can have following abstractions for now:
pub fn new() -> Result<Self>;
pub fn new_zeroed() -> Result<Self>;
--
viresh
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2] rust: Add cpumask helpers
2025-02-24 8:56 ` Viresh Kumar
@ 2025-02-24 19:40 ` Yury Norov
0 siblings, 0 replies; 12+ messages in thread
From: Yury Norov @ 2025-02-24 19:40 UTC (permalink / raw)
To: Viresh Kumar
Cc: Miguel Ojeda, Danilo Krummrich, Rafael J. Wysocki, Alex Gaynor,
Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Alice Ryhl, Trevor Gross, Rasmus Villemoes,
Vincent Guittot, Stephen Boyd, Nishanth Menon,
Manos Pitsidianakis, Erik Schilling, Alex Bennée,
Joakim Bech, Rob Herring, Christoph Hellwig, Jason Gunthorpe,
John Hubbard, linux-pm, rust-for-linux, linux-kernel
On Mon, Feb 24, 2025 at 02:26:13PM +0530, Viresh Kumar wrote:
> Hi Yury,
>
> On 21-02-25, 15:56, Yury Norov wrote:
> > Question: zalloc_cpumask_war() is a convenient wrapper around
> > alloc_cpumask_var_node(). Maybe rust can use the latter directly as it's
> > a true outlined function? There's more flexibility, if you need it, but
> > also a higher risk that the API will change: ~40 users vs 180 for zalloc
> > thing. Up to you guys. I can send v2 if needed.
>
> I looked at the APIs again and here is what I feel:
>
> - I am not sure if the Rust code will have any users of the *_node()
> APIs in the near future. i.e. There is no need for the Rust code to
> implement Cpumask::new_node() version for now.
>
> - I have missed implementing the uninitialized version earlier,
> alloc_cpumask_var(), which I think should be implemented right away.
> Bindings for alloc_cpumask_var() are required to be added for this
> though.
>
> - One advantage of using zalloc_cpumask_var() instead of
> alloc_cpumask_var() is that we don't need to open code it in the
> Rust code, specifically for the !CONFIG_CPUMASK_OFFSTACK case where
> we need to call cpumask_clear() separately.
>
> - The Rust side can have following abstractions for now:
>
> pub fn new() -> Result<Self>;
> pub fn new_zeroed() -> Result<Self>;
>
> --
> viresh
OK, if you need both I'll export both. I'll send it in v2 together
with clarifications from discussion with Miguel.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v2 0/2] Bitmap bindings for rust
@ 2025-02-24 23:39 Yury Norov
2025-02-24 23:39 ` [PATCH 1/2] rust: Add cpumask helpers Yury Norov
` (2 more replies)
0 siblings, 3 replies; 12+ messages in thread
From: Yury Norov @ 2025-02-24 23:39 UTC (permalink / raw)
To: Miguel Ojeda, Viresh Kumar, Danilo Krummrich
Cc: Yury Norov, Rafael J. Wysocki, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
Trevor Gross, Rasmus Villemoes, Vincent Guittot, Stephen Boyd,
Nishanth Menon, Manos Pitsidianakis, Erik Schilling,
Alex Bennée, Joakim Bech, Rob Herring, Christoph Hellwig,
Jason Gunthorpe, John Hubbard, linux-pm, rust-for-linux,
linux-kernel
The bindings and a new maintenance entry together with the API changes
policy.
v1: https://lore.kernel.org/all/20250221205649.141305-1-yury.norov@gmail.com/T/
v2:
- export alloc_cpumask_var() @ Viresh;
- clarify that the maintenance rules apply to all bitmap interfaces,
including those not mentioned explicitly in the helpers @ Miguel.
Viresh Kumar (1):
rust: Add cpumask helpers
Yury Norov [NVIDIA] (1):
MAINTAINERS: add rust bindings entry for bitmap API
MAINTAINERS | 5 ++++
rust/bindings/bindings_helper.h | 1 +
rust/helpers/cpumask.c | 45 +++++++++++++++++++++++++++++++++
rust/helpers/helpers.c | 1 +
4 files changed, 52 insertions(+)
create mode 100644 rust/helpers/cpumask.c
--
2.43.0
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 1/2] rust: Add cpumask helpers
2025-02-24 23:39 [PATCH v2 0/2] Bitmap bindings for rust Yury Norov
@ 2025-02-24 23:39 ` Yury Norov
2025-02-25 9:24 ` Alice Ryhl
2025-02-25 9:43 ` Daniel Almeida
2025-02-24 23:39 ` [PATCH 2/2] MAINTAINERS: add rust bindings entry for bitmap API Yury Norov
2025-02-28 18:42 ` [PATCH v2 0/2] Bitmap bindings for rust Yury Norov
2 siblings, 2 replies; 12+ messages in thread
From: Yury Norov @ 2025-02-24 23:39 UTC (permalink / raw)
To: Miguel Ojeda, Viresh Kumar, Danilo Krummrich
Cc: Yury Norov, Rafael J. Wysocki, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
Trevor Gross, Rasmus Villemoes, Vincent Guittot, Stephen Boyd,
Nishanth Menon, Manos Pitsidianakis, Erik Schilling,
Alex Bennée, Joakim Bech, Rob Herring, Christoph Hellwig,
Jason Gunthorpe, John Hubbard, linux-pm, rust-for-linux,
linux-kernel
From: Viresh Kumar <viresh.kumar@linaro.org>
In order to prepare for adding Rust abstractions for cpumask, add
the required helpers for inline cpumask functions that cannot be
called by rust code directly.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Yury Norov [NVIDIA] <yury.norov@gmail.com>
---
rust/bindings/bindings_helper.h | 1 +
rust/helpers/cpumask.c | 45 +++++++++++++++++++++++++++++++++
rust/helpers/helpers.c | 1 +
3 files changed, 47 insertions(+)
create mode 100644 rust/helpers/cpumask.c
diff --git a/rust/bindings/bindings_helper.h b/rust/bindings/bindings_helper.h
index f46cf3bb7069..2396ca1cf8fb 100644
--- a/rust/bindings/bindings_helper.h
+++ b/rust/bindings/bindings_helper.h
@@ -10,6 +10,7 @@
#include <linux/blk-mq.h>
#include <linux/blk_types.h>
#include <linux/blkdev.h>
+#include <linux/cpumask.h>
#include <linux/cred.h>
#include <linux/device/faux.h>
#include <linux/errname.h>
diff --git a/rust/helpers/cpumask.c b/rust/helpers/cpumask.c
new file mode 100644
index 000000000000..2d380a86c34a
--- /dev/null
+++ b/rust/helpers/cpumask.c
@@ -0,0 +1,45 @@
+// SPDX-License-Identifier: GPL-2.0
+
+#include <linux/cpumask.h>
+
+void rust_helper_cpumask_set_cpu(unsigned int cpu, struct cpumask *dstp)
+{
+ cpumask_set_cpu(cpu, dstp);
+}
+
+void rust_helper_cpumask_clear_cpu(int cpu, struct cpumask *dstp)
+{
+ cpumask_clear_cpu(cpu, dstp);
+}
+
+void rust_helper_cpumask_setall(struct cpumask *dstp)
+{
+ cpumask_setall(dstp);
+}
+
+unsigned int rust_helper_cpumask_weight(struct cpumask *srcp)
+{
+ return cpumask_weight(srcp);
+}
+
+void rust_helper_cpumask_copy(struct cpumask *dstp, const struct cpumask *srcp)
+{
+ cpumask_copy(dstp, srcp);
+}
+
+bool rust_helper_alloc_cpumask_var(cpumask_var_t *mask, gfp_t flags)
+{
+ return alloc_cpumask_var(mask, flags);
+}
+
+bool rust_helper_zalloc_cpumask_var(cpumask_var_t *mask, gfp_t flags)
+{
+ return zalloc_cpumask_var(mask, flags);
+}
+
+#ifndef CONFIG_CPUMASK_OFFSTACK
+void rust_helper_free_cpumask_var(cpumask_var_t mask)
+{
+ free_cpumask_var(mask);
+}
+#endif
diff --git a/rust/helpers/helpers.c b/rust/helpers/helpers.c
index 0640b7e115be..de2341cfd917 100644
--- a/rust/helpers/helpers.c
+++ b/rust/helpers/helpers.c
@@ -11,6 +11,7 @@
#include "bug.c"
#include "build_assert.c"
#include "build_bug.c"
+#include "cpumask.c"
#include "cred.c"
#include "device.c"
#include "err.c"
--
2.43.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 2/2] MAINTAINERS: add rust bindings entry for bitmap API
2025-02-24 23:39 [PATCH v2 0/2] Bitmap bindings for rust Yury Norov
2025-02-24 23:39 ` [PATCH 1/2] rust: Add cpumask helpers Yury Norov
@ 2025-02-24 23:39 ` Yury Norov
2025-02-25 3:19 ` Viresh Kumar
2025-02-28 18:42 ` [PATCH v2 0/2] Bitmap bindings for rust Yury Norov
2 siblings, 1 reply; 12+ messages in thread
From: Yury Norov @ 2025-02-24 23:39 UTC (permalink / raw)
To: Miguel Ojeda, Viresh Kumar, Danilo Krummrich
Cc: Yury Norov, Rafael J. Wysocki, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
Trevor Gross, Rasmus Villemoes, Vincent Guittot, Stephen Boyd,
Nishanth Menon, Manos Pitsidianakis, Erik Schilling,
Alex Bennée, Joakim Bech, Rob Herring, Christoph Hellwig,
Jason Gunthorpe, John Hubbard, linux-pm, rust-for-linux,
linux-kernel
From: "Yury Norov [NVIDIA]" <yury.norov@gmail.com>
This entry enumerates bitmap and related APIs listed in BITMAP API entry
that rust requires but cannot use directly (i.e. inlined functions and
macros).
The "Rust kernel policy" (https://rust-for-linux.com/rust-kernel-policy)
document describes the special status of rust support:
"Exceptionally, for Rust, a subsystem may allow to temporarily
break Rust code."
Accordingly, the following policy applies to all interfaces under the
BITMAP API entry that are used in rust codebase, including those not
listed explicitly here.
Bitmap developers do their best to keep the API stable. When API or
user-visible behavior needs to be changed such that it breaks rust,
bitmap and rust developers collaborate as follows:
- bitmap developers don't consider rust bindings as a blocker for the
API change;
- bindings maintainer (me) makes sure that kernel build doesn't break
with CONFIG_RUST=y. This implies fixes in the binding layer, but not
in rust codebase;
- rust developers adopt new version of API in their codebase and remove
unused bindings timely.
CC: Danilo Krummrich <dakr@redhat.com>
CC: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
CC: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Yury Norov [NVIDIA] <yury.norov@gmail.com>
---
MAINTAINERS | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index efee40ea589f..315cff76df29 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4021,6 +4021,11 @@ F: tools/include/vdso/bits.h
F: tools/lib/bitmap.c
F: tools/lib/find_bit.c
+BITMAP API BINDINGS [RUST]
+M: Yury Norov <yury.norov@gmail.com>
+S: Maintained
+F: rust/helpers/cpumask.c
+
BITOPS API
M: Yury Norov <yury.norov@gmail.com>
R: Rasmus Villemoes <linux@rasmusvillemoes.dk>
--
2.43.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 2/2] MAINTAINERS: add rust bindings entry for bitmap API
2025-02-24 23:39 ` [PATCH 2/2] MAINTAINERS: add rust bindings entry for bitmap API Yury Norov
@ 2025-02-25 3:19 ` Viresh Kumar
0 siblings, 0 replies; 12+ messages in thread
From: Viresh Kumar @ 2025-02-25 3:19 UTC (permalink / raw)
To: Yury Norov
Cc: Miguel Ojeda, Danilo Krummrich, Rafael J. Wysocki, Alex Gaynor,
Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Alice Ryhl, Trevor Gross, Rasmus Villemoes,
Vincent Guittot, Stephen Boyd, Nishanth Menon,
Manos Pitsidianakis, Erik Schilling, Alex Bennée,
Joakim Bech, Rob Herring, Christoph Hellwig, Jason Gunthorpe,
John Hubbard, linux-pm, rust-for-linux, linux-kernel
On 24-02-25, 18:39, Yury Norov wrote:
> From: "Yury Norov [NVIDIA]" <yury.norov@gmail.com>
>
> This entry enumerates bitmap and related APIs listed in BITMAP API entry
> that rust requires but cannot use directly (i.e. inlined functions and
> macros).
>
> The "Rust kernel policy" (https://rust-for-linux.com/rust-kernel-policy)
> document describes the special status of rust support:
>
> "Exceptionally, for Rust, a subsystem may allow to temporarily
> break Rust code."
>
> Accordingly, the following policy applies to all interfaces under the
> BITMAP API entry that are used in rust codebase, including those not
> listed explicitly here.
>
> Bitmap developers do their best to keep the API stable. When API or
> user-visible behavior needs to be changed such that it breaks rust,
> bitmap and rust developers collaborate as follows:
> - bitmap developers don't consider rust bindings as a blocker for the
> API change;
> - bindings maintainer (me) makes sure that kernel build doesn't break
> with CONFIG_RUST=y. This implies fixes in the binding layer, but not
> in rust codebase;
> - rust developers adopt new version of API in their codebase and remove
> unused bindings timely.
>
> CC: Danilo Krummrich <dakr@redhat.com>
> CC: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
> CC: Viresh Kumar <viresh.kumar@linaro.org>
> Signed-off-by: Yury Norov [NVIDIA] <yury.norov@gmail.com>
> ---
> MAINTAINERS | 5 +++++
> 1 file changed, 5 insertions(+)
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
--
viresh
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2] rust: Add cpumask helpers
2025-02-24 23:39 ` [PATCH 1/2] rust: Add cpumask helpers Yury Norov
@ 2025-02-25 9:24 ` Alice Ryhl
2025-02-25 9:43 ` Daniel Almeida
1 sibling, 0 replies; 12+ messages in thread
From: Alice Ryhl @ 2025-02-25 9:24 UTC (permalink / raw)
To: Yury Norov
Cc: Miguel Ojeda, Viresh Kumar, Danilo Krummrich, Rafael J. Wysocki,
Alex Gaynor, Boqun Feng, Gary Guo, Björn Roy Baron,
Benno Lossin, Andreas Hindborg, Trevor Gross, Rasmus Villemoes,
Vincent Guittot, Stephen Boyd, Nishanth Menon,
Manos Pitsidianakis, Erik Schilling, Alex Bennée,
Joakim Bech, Rob Herring, Christoph Hellwig, Jason Gunthorpe,
John Hubbard, linux-pm, rust-for-linux, linux-kernel
On Tue, Feb 25, 2025 at 12:39 AM Yury Norov <yury.norov@gmail.com> wrote:
>
> From: Viresh Kumar <viresh.kumar@linaro.org>
>
> In order to prepare for adding Rust abstractions for cpumask, add
> the required helpers for inline cpumask functions that cannot be
> called by rust code directly.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> Signed-off-by: Yury Norov [NVIDIA] <yury.norov@gmail.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2] rust: Add cpumask helpers
2025-02-24 23:39 ` [PATCH 1/2] rust: Add cpumask helpers Yury Norov
2025-02-25 9:24 ` Alice Ryhl
@ 2025-02-25 9:43 ` Daniel Almeida
2025-02-25 9:50 ` Viresh Kumar
1 sibling, 1 reply; 12+ messages in thread
From: Daniel Almeida @ 2025-02-25 9:43 UTC (permalink / raw)
To: Yury Norov
Cc: Miguel Ojeda, Viresh Kumar, Danilo Krummrich, Rafael J. Wysocki,
Alex Gaynor, Boqun Feng, Gary Guo, Björn Roy Baron,
Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross,
Rasmus Villemoes, Vincent Guittot, Stephen Boyd, Nishanth Menon,
Manos Pitsidianakis, Erik Schilling, Alex Bennée,
Joakim Bech, Rob Herring, Christoph Hellwig, Jason Gunthorpe,
John Hubbard, linux-pm, rust-for-linux, linux-kernel
Hi Yury,
> On 24 Feb 2025, at 20:39, Yury Norov <yury.norov@gmail.com> wrote:
>
> From: Viresh Kumar <viresh.kumar@linaro.org>
>
> In order to prepare for adding Rust abstractions for cpumask, add
> the required helpers for inline cpumask functions that cannot be
> called by rust code directly.
I don’t understand what is going on here. You apparently did not provide the
Rust code itself.
Usually, when I see a “in order to prepare for …” I expect the actual patch to
follow in the same series.
Right now - and correct me if I'm wrong - it seems like you’ve essentially added
dead code.
— Daniel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2] rust: Add cpumask helpers
2025-02-25 9:43 ` Daniel Almeida
@ 2025-02-25 9:50 ` Viresh Kumar
2025-02-26 16:17 ` Yury Norov
0 siblings, 1 reply; 12+ messages in thread
From: Viresh Kumar @ 2025-02-25 9:50 UTC (permalink / raw)
To: Daniel Almeida
Cc: Yury Norov, Miguel Ojeda, Danilo Krummrich, Rafael J. Wysocki,
Alex Gaynor, Boqun Feng, Gary Guo, Björn Roy Baron,
Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross,
Rasmus Villemoes, Vincent Guittot, Stephen Boyd, Nishanth Menon,
Manos Pitsidianakis, Erik Schilling, Alex Bennée,
Joakim Bech, Rob Herring, Christoph Hellwig, Jason Gunthorpe,
John Hubbard, linux-pm, rust-for-linux, linux-kernel
On 25-02-25, 06:43, Daniel Almeida wrote:
> I don’t understand what is going on here. You apparently did not provide the
> Rust code itself.
>
> Usually, when I see a “in order to prepare for …” I expect the actual patch to
> follow in the same series.
>
> Right now - and correct me if I'm wrong - it seems like you’ve essentially added
> dead code.
Rust abstractions:
https://lore.kernel.org/all/cover.1740475625.git.viresh.kumar@linaro.org/
--
viresh
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2] rust: Add cpumask helpers
2025-02-25 9:50 ` Viresh Kumar
@ 2025-02-26 16:17 ` Yury Norov
0 siblings, 0 replies; 12+ messages in thread
From: Yury Norov @ 2025-02-26 16:17 UTC (permalink / raw)
To: Viresh Kumar
Cc: Daniel Almeida, Miguel Ojeda, Danilo Krummrich, Rafael J. Wysocki,
Alex Gaynor, Boqun Feng, Gary Guo, Björn Roy Baron,
Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross,
Rasmus Villemoes, Vincent Guittot, Stephen Boyd, Nishanth Menon,
Manos Pitsidianakis, Erik Schilling, Alex Bennée,
Joakim Bech, Rob Herring, Christoph Hellwig, Jason Gunthorpe,
John Hubbard, linux-pm, rust-for-linux, linux-kernel
On Tue, Feb 25, 2025 at 03:20:54PM +0530, Viresh Kumar wrote:
> On 25-02-25, 06:43, Daniel Almeida wrote:
> > I don’t understand what is going on here. You apparently did not provide the
> > Rust code itself.
> >
> > Usually, when I see a “in order to prepare for …” I expect the actual patch to
> > follow in the same series.
> >
> > Right now - and correct me if I'm wrong - it seems like you’ve essentially added
> > dead code.
>
> Rust abstractions:
>
> https://lore.kernel.org/all/cover.1740475625.git.viresh.kumar@linaro.org/
Yes, it's a dead code.
Cpumasks is a library, and people sometimes submit library code separately
from their main projects, so it becomes unused for a while. GENMASK_U128()
is one recent example.
I'm not happy about it, but I understand why people do so - it's important
for them to have stable API, and their big project may take longer to get
upstreamed.
So, if nobody's strongly opposite, I will move it myself. Alternatively,
we can ask Viresh to take over the patches and move them together with
his series.
Thanks,
Yury
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 0/2] Bitmap bindings for rust
2025-02-24 23:39 [PATCH v2 0/2] Bitmap bindings for rust Yury Norov
2025-02-24 23:39 ` [PATCH 1/2] rust: Add cpumask helpers Yury Norov
2025-02-24 23:39 ` [PATCH 2/2] MAINTAINERS: add rust bindings entry for bitmap API Yury Norov
@ 2025-02-28 18:42 ` Yury Norov
2 siblings, 0 replies; 12+ messages in thread
From: Yury Norov @ 2025-02-28 18:42 UTC (permalink / raw)
To: Miguel Ojeda, Viresh Kumar, Danilo Krummrich
Cc: Rafael J. Wysocki, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
Trevor Gross, Rasmus Villemoes, Vincent Guittot, Stephen Boyd,
Nishanth Menon, Manos Pitsidianakis, Erik Schilling,
Alex Bennée, Joakim Bech, Rob Herring, Christoph Hellwig,
Jason Gunthorpe, John Hubbard, linux-pm, rust-for-linux,
linux-kernel
On Mon, Feb 24, 2025 at 06:39:34PM -0500, Yury Norov wrote:
> The bindings and a new maintenance entry together with the API changes
> policy.
>
> v1: https://lore.kernel.org/all/20250221205649.141305-1-yury.norov@gmail.com/T/
> v2:
> - export alloc_cpumask_var() @ Viresh;
> - clarify that the maintenance rules apply to all bitmap interfaces,
> including those not mentioned explicitly in the helpers @ Miguel.
OK, adding in bitmap-for-next for testing.
Thanks,
Yury
> Viresh Kumar (1):
> rust: Add cpumask helpers
>
> Yury Norov [NVIDIA] (1):
> MAINTAINERS: add rust bindings entry for bitmap API
>
> MAINTAINERS | 5 ++++
> rust/bindings/bindings_helper.h | 1 +
> rust/helpers/cpumask.c | 45 +++++++++++++++++++++++++++++++++
> rust/helpers/helpers.c | 1 +
> 4 files changed, 52 insertions(+)
> create mode 100644 rust/helpers/cpumask.c
>
> --
> 2.43.0
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2025-02-28 18:42 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-24 23:39 [PATCH v2 0/2] Bitmap bindings for rust Yury Norov
2025-02-24 23:39 ` [PATCH 1/2] rust: Add cpumask helpers Yury Norov
2025-02-25 9:24 ` Alice Ryhl
2025-02-25 9:43 ` Daniel Almeida
2025-02-25 9:50 ` Viresh Kumar
2025-02-26 16:17 ` Yury Norov
2025-02-24 23:39 ` [PATCH 2/2] MAINTAINERS: add rust bindings entry for bitmap API Yury Norov
2025-02-25 3:19 ` Viresh Kumar
2025-02-28 18:42 ` [PATCH v2 0/2] Bitmap bindings for rust Yury Norov
-- strict thread matches above, loose matches on Subject: below --
2025-02-21 20:56 [PATCH " Yury Norov
2025-02-21 20:56 ` [PATCH 1/2] rust: Add cpumask helpers Yury Norov
2025-02-24 8:56 ` Viresh Kumar
2025-02-24 19:40 ` Yury Norov
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).