Merge "mm, page_alloc: fix core hung in free_pcppages_bulk()"

This commit is contained in:
qctecmdr
2020-06-25 01:50:15 -07:00
committed by Gerrit - the friendly Code Review server
2 changed files with 5 additions and 6 deletions

View File

@@ -914,7 +914,6 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages, int online_typ
node_states_set_node(nid, &arg); node_states_set_node(nid, &arg);
if (need_zonelists_rebuild) if (need_zonelists_rebuild)
build_all_zonelists(NULL); build_all_zonelists(NULL);
else
zone_pcp_update(zone); zone_pcp_update(zone);
} }

View File

@@ -3036,7 +3036,7 @@ static void free_unref_page_commit(struct page *page, unsigned long pfn)
{ {
struct zone *zone = page_zone(page); struct zone *zone = page_zone(page);
struct per_cpu_pages *pcp; struct per_cpu_pages *pcp;
int migratetype; int migratetype, high, batch;
migratetype = get_pcppage_migratetype(page); migratetype = get_pcppage_migratetype(page);
__count_vm_event(PGFREE); __count_vm_event(PGFREE);
@@ -3059,11 +3059,11 @@ static void free_unref_page_commit(struct page *page, unsigned long pfn)
pcp = &this_cpu_ptr(zone->pageset)->pcp; pcp = &this_cpu_ptr(zone->pageset)->pcp;
list_add(&page->lru, &pcp->lists[migratetype]); list_add(&page->lru, &pcp->lists[migratetype]);
pcp->count++; pcp->count++;
if (pcp->count >= pcp->high) { high = READ_ONCE(pcp->high);
unsigned long batch = READ_ONCE(pcp->batch); batch = READ_ONCE(pcp->batch);
if ((high > batch) && pcp->count >= high)
free_pcppages_bulk(zone, batch, pcp); free_pcppages_bulk(zone, batch, pcp);
} }
}
/* /*
* Free a 0-order page * Free a 0-order page