lkml.org 
[lkml]   [2022]   [Jan]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCHv2 6/7] x86/mm: Provide helpers for unaccepted memory
On Tue, Jan 11, 2022 at 12:01:56PM -0800, Dave Hansen wrote:
> On 1/11/22 03:33, Kirill A. Shutemov wrote:
> > Core-mm requires few helpers to support unaccepted memory:
> >
> > - accept_memory() checks the range of addresses against the bitmap and
> > accept memory if needed;
> >
> > - maybe_set_page_offline() checks the bitmap and marks a page with
> > PageOffline() if memory acceptance required on the first
> > allocation of the page.
> >
> > - accept_and_clear_page_offline() accepts memory for the page and clears
> > PageOffline().
> >
> ...
> > +void accept_memory(phys_addr_t start, phys_addr_t end)
> > +{
> > + unsigned long flags;
> > + if (!boot_params.unaccepted_memory)
> > + return;
> > +
> > + spin_lock_irqsave(&unaccepted_memory_lock, flags);
> > + __accept_memory(start, end);
> > + spin_unlock_irqrestore(&unaccepted_memory_lock, flags);
> > +}
>
> Not a big deal, but please cc me on all the patches in the series. This is
> called from the core mm patches which I wasn't cc'd on.
>
> This also isn't obvious, but this introduces a new, global lock into the
> fast path of the page allocator and holds it for extended periods of time.
> It won't be taken any more once all memory is accepted, but you can sure bet
> that it will be noticeable until that happens.
>
> *PLEASE* document this. It needs changelog and probably code comments.

Okay, will do.

--
Kirill A. Shutemov

\
 
 \ /
  Last update: 2022-01-12 20:47    [W:0.051 / U:0.652 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site