Re: [patch 2/2] mm, compaction: return failed migration target pages back to freelist

David Rientjes
2014-05-01T21:02:05Z

On Thu, 1 May 2014, Naoya Horiguchi wrote:

> > diff --git a/mm/compaction.c b/mm/compaction.c
> > --- a/mm/compaction.c
> > +++ b/mm/compaction.c
> > @@ -797,6 +797,19 @@ static struct page *compaction_alloc(struct page *migratepage,
> > }
> >
> > /*
> > + * This is a migrate-callback that "frees" freepages back to the isolated
> > + * freelist. All pages on the freelist are from the same zone, so there is no
> > + * special handling needed for NUMA.
> > + */
> > +static void compaction_free(struct page *page, unsigned long data)
> > +{
> > + struct compact_control *cc = (struct compact_control *)data;
> > +
> > + list_add(&page->lru, &cc->freepages);
> > + cc->nr_freepages++;
>
> With this change, migration_page() handles cc->nr_freepages consistently, so
> we don't have to run over freelist to update this count in update_nr_listpages()?
>

Good optimization, I'll add it!