lkml.org 
[lkml]   [2024]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2 4/4] rust: add abstraction for `struct page`
On Tue, Feb 27, 2024 at 4:37 PM Matthew Wilcox <willy@infradead.org> wrote:
>
> On Thu, Feb 08, 2024 at 03:47:54PM +0000, Alice Ryhl wrote:
> > +impl Page {
> > + /// Allocates a new page.
> > + pub fn new() -> Result<Self, AllocError> {
> > + // SAFETY: These are the correct arguments to allocate a single page.
> > + let page = unsafe {
> > + bindings::alloc_pages(
> > + bindings::GFP_KERNEL | bindings::__GFP_ZERO | bindings::__GFP_HIGHMEM,
>
> I thought I raised this last time, but this is over-specialised for
> Binder's purposes. Many places that want to allocate a page want
> different GFP flags from this; they shouldn't even be the default flags.
> So either what you're defining here is a BinderPage, or new() needs
> to take GFP flags.

Ah, yeah, sorry. I never got around to figuring that out.

I can change it to take GFP flags.

Thank you for taking another look!
Alice

\
 
 \ /
  Last update: 2024-05-27 15:25    [W:0.127 / U:1.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site