Re: [PATCH 8/9] mm, page_alloc: drain all pcplists during memory offline

From: Michal Hocko
Date: Mon Oct 05 2020 - 10:03:35 EST


On Fri 25-09-20 12:46:27, David Hildenbrand wrote:
> On 22.09.20 16:37, Vlastimil Babka wrote:
[...]
> > +/*
> > + * Spill all the per-cpu pages from all CPUs back into the buddy allocator.
> > + *
> > + * When zone parameter is non-NULL, spill just the single zone's pages.
> > + *
> > + * Note that this can be extremely slow as the draining happens in a workqueue.
> > + */
> > +void drain_all_pages(struct zone *zone)
> > +{
> > + __drain_all_pages(zone, false);
> > +}
> > +
> > #ifdef CONFIG_HIBERNATION
> >
> > /*
> >
>
> Interesting race. Instead of this ugly __drain_all_pages() with a
> boolean parameter, can we have two properly named functions to be used
> in !page_alloc.c code without scratching your head what the difference is?

I tend to agree here. I would even fold this into the next patch because
disable/enable interface is much more manageable.

--
Michal Hocko
SUSE Labs