[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8943835861763052c6a6e4d8cb774f6366b99092.camel@intel.com>
Date: Thu, 9 Mar 2023 15:34:25 +0000
From: "Edgecombe, Rick P" <rick.p.edgecombe@...el.com>
To: "rppt@...nel.org" <rppt@...nel.org>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"peterz@...radead.org" <peterz@...radead.org>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"song@...nel.org" <song@...nel.org>,
"dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>,
"vbabka@...e.cz" <vbabka@...e.cz>,
"x86@...nel.org" <x86@...nel.org>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>
Subject: Re: [RFC PATCH 1/5] mm: intorduce __GFP_UNMAPPED and unmapped_alloc()
On Thu, 2023-03-09 at 16:39 +0200, Mike Rapoport wrote:
> On Thu, Mar 09, 2023 at 01:56:37AM +0000, Edgecombe, Rick P wrote:
> > On Wed, 2023-03-08 at 11:41 +0200, Mike Rapoport wrote:
> > > +
> > > +static inline void __free_one_page(struct page *page, unsigned
> > > int
> > > order,
> > > + bool cache_refill)
> > > +{
> > > + unsigned long pfn = page_to_pfn(page);
> > > + unsigned long buddy_pfn;
> > > + unsigned long combined_pfn;
> > > + struct page *buddy;
> > > + unsigned long flags;
> > > +
> > > + spin_lock_irqsave(&free_area->lock, flags);
> > > +
> > > + if (cache_refill) {
> > > + set_pageblock_unmapped(page);
> > > + free_area[order].nr_cached++;
> > > + }
> > > +
> > > + while (order < MAX_ORDER - 1) {
> > > + buddy = find_unmapped_buddy_page_pfn(page, pfn,
> > > order,
> > > + &buddy_pfn);
> > > + if (!buddy)
> > > + break;
> > > +
> > > + del_page_from_free_list(buddy, order);
> > > + combined_pfn = buddy_pfn & pfn;
> > > + page = page + (combined_pfn - pfn);
> > > + pfn = combined_pfn;
> > > + order++;
> > > + }
> > > +
> > > + set_unmapped_order(page, order);
> > > + add_to_free_list(page, order);
> > > + spin_unlock_irqrestore(&free_area->lock, flags);
> > > +}
> > > +
> >
> > The page has to be zeroed before it goes back on the list, right? I
> > didn't see it.
>
> You are right, I missed it.
The text_poke() family is probably the way on x86, but I don't think
there is a cross-arch way that doesn't involve kernel shootdowns...
Powered by blists - more mailing lists