mm, page_alloc: remove unnecessary variable from free_pcppages_bulk
PATCH 1/1 mm, page_alloc: remove unnecessary variable from free_pcppages_bulk
From: Mel Gorman <[email protected]>
[ Upstream commit e5b31ac2ca2cd0cf6bf2fcbb708ed01466c89aaa ]
The original count is never reused so it can be removed.
---
Hi,
The backport commit 0c9ce43da97d ("mm, page_alloc: fix core hung in free_pcppages_bulk()") has the depency to this commit. It went in v4.6 so only v4.4 is effected.
Thanks,
Daniel
mm/page_alloc.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
mm/page_alloc.c +3 -4
@@ -835,7 +835,6 @@ static void free_pcppages_bulk(struct zone *zone, int count, {int migratetype =0 ;int batch_free =0 ; -int to_free = count;unsigned long nr_scanned;spin_lock (&zone->lock);
@@ -848,7 +847,7 @@ static void free_pcppages_bulk(struct zone *zone, int count,* below while (list_empty(list)) loop. */ count =min (pcp->count, count); -while (to_free) { +while (count) {struct page *page;struct list_head *list;
@@ -868,7 +867,7 @@ static void free_pcppages_bulk(struct zone *zone, int count,/* This is the only non-empty list. Free them all. */ if (batch_free ==MIGRATE_PCPTYPES ) - batch_free = to_free; + batch_free = count; do { int mt; /* migratetype of the to-be-freed page */
@@ -886,7 +885,7 @@ static void free_pcppages_bulk(struct zone *zone, int count,__free_one_page (page,page_to_pfn (page), zone,0 , mt);trace_mm_page_pcpu_drain (page,0 , mt); - }while (--to_free && --batch_free && !list_empty (list)); + }while (--count && --batch_free && !list_empty (list)); }spin_unlock (&zone->lock); }
Signature · 1 line
2.28.0
Greg KH
maintainerQuoted 13 lines · Daniel Wagner
From: Mel Gorman <[email protected]>
[ Upstream commit
e5b31ac2ca2cd0cf6bf2fcbb708ed01466c89aaa]The original count is never reused so it can be removed.
Signed-off-by Mel Gorman <[email protected]>Acked-by Vlastimil Babka <[email protected]>Cc Jesper Dangaard Brouer <[email protected]>Signed-off-by Andrew Morton <[email protected]>Signed-off-by Linus Torvalds <[email protected]>[dwagner: update context]Signed-off-by Daniel Wagner <[email protected]>
Quoted 6 lines
---
Hi,The backport commit
0c9ce43da97d("mm,page_alloc: fix core hung infree_pcppages_bulk()") has the depency to this commit. It went in v4.6 so only v4.4 is effected.
Thanks for the backport, now queued up.
greg k-h