lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAH5fLgjF-_CKsgKm1OkSFMBt_HScO0o0fJBnaQY6W7fm1yPFiA@mail.gmail.com>
Date: Fri, 26 Jul 2024 21:04:07 +0200
From: Alice Ryhl <aliceryhl@...gle.com>
To: Benno Lossin <benno.lossin@...ton.me>
Cc: Miguel Ojeda <ojeda@...nel.org>, Andrew Morton <akpm@...ux-foundation.org>, 
	Alex Gaynor <alex.gaynor@...il.com>, Wedson Almeida Filho <wedsonaf@...il.com>, 
	Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>, 
	Björn Roy Baron <bjorn3_gh@...tonmail.com>, 
	Andreas Hindborg <a.hindborg@...sung.com>, linux-kernel@...r.kernel.org, linux-mm@...ck.org, 
	rust-for-linux@...r.kernel.org
Subject: Re: [PATCH] rust: mm: add abstractions for mm_struct and vm_area_struct

On Fri, Jul 26, 2024 at 3:37 PM Benno Lossin <benno.lossin@...ton.me> wrote:
>
> On 26.07.24 10:32, Alice Ryhl wrote:
> > On Fri, Jul 26, 2024 at 10:11 AM Benno Lossin <benno.lossin@...ton.me> wrote:
> >>
> >> On 23.07.24 16:32, Alice Ryhl wrote:
> >>> This is a follow-up to the page abstractions [1] that were recently
> >>> merged in 6.11. Rust Binder will need these abstractions to manipulate
> >>> the vma in its implementation of the mmap fop on the Binder file.
> >>>
> >>> The ARef wrapper is not used for mm_struct because there are several
> >>> different types of refcounts.
> >>
> >> I am confused, why can't you use the `ARef` wrapper for the different
> >> types that you create below?
> >
> > Well, maybe I can, but it means we have several wrapper structs of
> > Opaque<mm_struct>. Would it not be confusing? Could you suggest a
> > naming scheme for the structs I should have?
>
> I don't know of a good way to avoid that, IMO your current
> implementation has the same issue (multiple wrappers). So I don't think
> it's that bad to have multiple wrappers for one C struct.
> We could also use generics to solve this, right? I am not sure about the
> ergonomics/looks, so for example:
> - ARef<Mm<Grab>>
> - ARef<Mm<Get>>
> - ARef<Mm<Async>>
>
> I think it looks fine, then you also only have one struct wrapper.
>
> BTW what does "mm" stand for? Memory management?

mm stands for memory management. Basically, an mm_struct keeps track
of the address space of a process, as far as I understand.

Alice

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ