diff options
author | Michael Bestas <mkbestas@lineageos.org> | 2020-09-19 12:58:54 +0300 |
---|---|---|
committer | Michael Bestas <mkbestas@lineageos.org> | 2020-09-19 12:58:54 +0300 |
commit | 3b601dd398b0f8a66744c0ecf384a6cbe65e36e7 (patch) | |
tree | 570d5895dfced5d2e443a7f9b8f6fa5f9a7560f3 /mm/page_alloc.c | |
parent | a638073161e90ac6dc0ffc2e27cbc4bcd3ff88c3 (diff) | |
parent | 5fd2d19eeb9767339e1338eb6789495d1812065b (diff) |
Merge branch 'android-4.4-p' of https://android.googlesource.com/kernel/common into lineage-17.1-caf-msm8998
This brings LA.UM.8.4.r1-05900-8x98.0 up to date with
https://android.googlesource.com/kernel/common/ android-4.4-p at commit:
5fd2d19eeb976 Merge 4.4.236 into android-4.4-p
Conflicts:
drivers/scsi/ufs/ufshcd.c
Change-Id: I22282a0d571bdb72f50d3fc1e2cee4443de1f7f4
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r-- | mm/page_alloc.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index f39656e80469..1dcb8ff0e681 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -859,7 +859,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); @@ -867,7 +866,12 @@ static void free_pcppages_bulk(struct zone *zone, int count, if (nr_scanned) __mod_zone_page_state(zone, NR_PAGES_SCANNED, -nr_scanned); - while (to_free) { + /* + * Ensure proper count is passed which otherwise would stuck in the + * below while (list_empty(list)) loop. + */ + count = min(pcp->count, count); + while (count) { struct page *page; struct list_head *list; @@ -887,7 +891,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 */ @@ -905,7 +909,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); } @@ -6382,7 +6386,7 @@ int __meminit init_per_zone_wmark_min(void) setup_per_zone_inactive_ratio(); return 0; } -core_initcall(init_per_zone_wmark_min) +postcore_initcall(init_per_zone_wmark_min) /* * min_free_kbytes_sysctl_handler - just a wrapper around proc_dointvec() so |