git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bridge: check brport attr show in brport_show
[pandora-kernel.git]
/
mm
/
compaction.c
diff --git
a/mm/compaction.c
b/mm/compaction.c
index
edc1e26
..
5f8ec82
100644
(file)
--- a/
mm/compaction.c
+++ b/
mm/compaction.c
@@
-330,8
+330,17
@@
static isolate_migrate_t isolate_migratepages(struct zone *zone,
continue;
nr_scanned++;
continue;
nr_scanned++;
- /* Get the page and skip if free */
+ /*
+ * Get the page and ensure the page is within the same zone.
+ * See the comment in isolate_freepages about overlapping
+ * nodes. It is deliberate that the new zone lock is not taken
+ * as memory compaction should not move pages between nodes.
+ */
page = pfn_to_page(low_pfn);
page = pfn_to_page(low_pfn);
+ if (page_zone(page) != zone)
+ continue;
+
+ /* Skip if free */
if (PageBuddy(page))
continue;
if (PageBuddy(page))
continue;
@@
-363,7
+372,7
@@
static isolate_migrate_t isolate_migratepages(struct zone *zone,
}
if (!cc->sync)
}
if (!cc->sync)
- mode |= ISOLATE_
CLEAN
;
+ mode |= ISOLATE_
ASYNC_MIGRATE
;
/* Try isolate the page */
if (__isolate_lru_page(page, mode, 0) != 0)
/* Try isolate the page */
if (__isolate_lru_page(page, mode, 0) != 0)
@@
-568,7
+577,7
@@
static int compact_zone(struct zone *zone, struct compact_control *cc)
nr_migrate = cc->nr_migratepages;
err = migrate_pages(&cc->migratepages, compaction_alloc,
(unsigned long)cc, false,
nr_migrate = cc->nr_migratepages;
err = migrate_pages(&cc->migratepages, compaction_alloc,
(unsigned long)cc, false,
- cc->sync);
+ cc->sync
? MIGRATE_SYNC_LIGHT : MIGRATE_ASYNC
);
update_nr_listpages(cc);
nr_remaining = cc->nr_migratepages;
update_nr_listpages(cc);
nr_remaining = cc->nr_migratepages;
@@
-583,8
+592,11
@@
static int compact_zone(struct zone *zone, struct compact_control *cc)
if (err) {
putback_lru_pages(&cc->migratepages);
cc->nr_migratepages = 0;
if (err) {
putback_lru_pages(&cc->migratepages);
cc->nr_migratepages = 0;
+ if (err == -ENOMEM) {
+ ret = COMPACT_PARTIAL;
+ goto out;
+ }
}
}
-
}
out:
}
out:
@@
-702,14
+714,12
@@
static int compact_node(int nid)
}
/* Compact all nodes in the system */
}
/* Compact all nodes in the system */
-static
int
compact_nodes(void)
+static
void
compact_nodes(void)
{
int nid;
for_each_online_node(nid)
compact_node(nid);
{
int nid;
for_each_online_node(nid)
compact_node(nid);
-
- return COMPACT_COMPLETE;
}
/* The written value is actually unused, all memory is compacted */
}
/* The written value is actually unused, all memory is compacted */
@@
-720,7
+730,7
@@
int sysctl_compaction_handler(struct ctl_table *table, int write,
void __user *buffer, size_t *length, loff_t *ppos)
{
if (write)
void __user *buffer, size_t *length, loff_t *ppos)
{
if (write)
-
return
compact_nodes();
+ compact_nodes();
return 0;
}
return 0;
}