Re: [PATCH 5/6] slab: Allocate frozen pages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 31, 2022 at 07:15:14PM +0200, David Hildenbrand wrote:
> On 31.05.22 17:06, Matthew Wilcox (Oracle) wrote:
> > Since slab does not use the page refcount, it can allocate and
> > free frozen pages, saving one atomic operation per free.
> 
> I assume that implies that pages that are actually allocated *from* the
> buddy now have a refcount == 0.

Yes.

> IIRC, page isolation code (e.g., !page_ref_count check in
> has_unmovable_pages()) assumes that any page with a refcount of 0 is
> essentially either already free (buddy) or is on its way of getting
> freed (!buddy).

That would be a bad assumption.  We already freeze pages for things like
splitting, migration, and replacement with a THP.  If the usage is just
an optimisation, then that's OK (and maybe the optimisation needs to be
tweaked to check PageSlab), but if the code depends on that being true,
it was already broken.

For this particular case, I think has_unmovable_pages() is only called
for ZONE_MOVEABLE and Slab never allocates from ZONE_MOVEABLE, so it's
not an issue?

> There might be other PFN walker code (like compaction) that makes
> similar assumptions that hold for now.
> 
> -- 
> Thanks,
> 
> David / dhildenb
> 
> 




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux