mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-10-31 18:09:19 +00:00
mm: compaction: make compact_control order signed
"order" is -1 when compacting via /proc/sys/vm/compact_memory. Making it unsigned causes a bug in __compact_pgdat() when we test: if (cc->order < 0 || !compaction_deferred(zone, cc->order)) compact_zone(zone, cc); [akpm@linux-foundation.org: make __compact_pgdat()'s comparison match other code sites] Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: Mel Gorman <mel@csn.ul.ie> Cc: Minchan Kim <minchan@kernel.org> Reviewed-by: Rik van Riel <riel@redhat.com> Cc: Andrea Arcangeli <aarcange@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
8575ec29f6
commit
aad6ec3777
1 changed files with 2 additions and 2 deletions
|
@ -35,7 +35,7 @@ struct compact_control {
|
||||||
unsigned long migrate_pfn; /* isolate_migratepages search base */
|
unsigned long migrate_pfn; /* isolate_migratepages search base */
|
||||||
bool sync; /* Synchronous migration */
|
bool sync; /* Synchronous migration */
|
||||||
|
|
||||||
unsigned int order; /* order a direct compactor needs */
|
int order; /* order a direct compactor needs */
|
||||||
int migratetype; /* MOVABLE, RECLAIMABLE etc */
|
int migratetype; /* MOVABLE, RECLAIMABLE etc */
|
||||||
struct zone *zone;
|
struct zone *zone;
|
||||||
};
|
};
|
||||||
|
@ -692,7 +692,7 @@ static int __compact_pgdat(pg_data_t *pgdat, struct compact_control *cc)
|
||||||
INIT_LIST_HEAD(&cc->freepages);
|
INIT_LIST_HEAD(&cc->freepages);
|
||||||
INIT_LIST_HEAD(&cc->migratepages);
|
INIT_LIST_HEAD(&cc->migratepages);
|
||||||
|
|
||||||
if (cc->order < 0 || !compaction_deferred(zone, cc->order))
|
if (cc->order == -1 || !compaction_deferred(zone, cc->order))
|
||||||
compact_zone(zone, cc);
|
compact_zone(zone, cc);
|
||||||
|
|
||||||
if (cc->order > 0) {
|
if (cc->order > 0) {
|
||||||
|
|
Loading…
Reference in a new issue