Re: [WIP 0/3] Memory model and atomic API in Rust

From: Boqun Feng
Date: Fri Mar 22 2024 - 20:50:03 EST


On Fri, Mar 22, 2024 at 05:15:08PM -0700, Boqun Feng wrote:
[...]
> >
> > I wonder about that. The disadvantage of only supporting LKMM atomics is
> > that we'll be incompatible with third party code, and we don't want to
> > be rolling all of our own data structures forever.
> >
>
> A possible solution to that is a set of C++ memory model atomics
> implemented by LKMM atomics. That should be possible.
>

Another possible "solution" works in the opposite direction, since the
folder rust/kernel/sync/atomic is quite stand-alone, we can export that
as a Rust crate (library), and third party code can support using LKMM
atomics instead of Rust own atomics ;-) Of course if the project is
supposed to work with Linux kernel.

Regards,
Boqun