Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 292626
b: refs/heads/master
c: 8575ec2
h: refs/heads/master
v: v3
  • Loading branch information
Hugh Dickins authored and Linus Torvalds committed Mar 22, 2012
1 parent 1b08109 commit 6d449cc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: aff622495c9a0b56148192e53bdec539f5e147f2
refs/heads/master: 8575ec29f61da83a2bf382c8c490499dc022101e
22 changes: 12 additions & 10 deletions trunk/mm/compaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -680,9 +680,6 @@ static int __compact_pgdat(pg_data_t *pgdat, struct compact_control *cc)
int zoneid;
struct zone *zone;

/* Flush pending updates to the LRU lists */
lru_add_drain_all();

for (zoneid = 0; zoneid < MAX_NR_ZONES; zoneid++) {

zone = &pgdat->node_zones[zoneid];
Expand Down Expand Up @@ -727,24 +724,22 @@ int compact_pgdat(pg_data_t *pgdat, int order)

static int compact_node(int nid)
{
pg_data_t *pgdat;
struct compact_control cc = {
.order = -1,
.sync = true,
};

if (nid < 0 || nid >= nr_node_ids || !node_online(nid))
return -EINVAL;
pgdat = NODE_DATA(nid);

return __compact_pgdat(pgdat, &cc);
return __compact_pgdat(NODE_DATA(nid), &cc);
}

/* Compact all nodes in the system */
static int compact_nodes(void)
{
int nid;

/* Flush pending updates to the LRU lists */
lru_add_drain_all();

for_each_online_node(nid)
compact_node(nid);

Expand Down Expand Up @@ -777,7 +772,14 @@ ssize_t sysfs_compact_node(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
compact_node(dev->id);
int nid = dev->id;

if (nid >= 0 && nid < nr_node_ids && node_online(nid)) {
/* Flush pending updates to the LRU lists */
lru_add_drain_all();

compact_node(nid);
}

return count;
}
Expand Down

0 comments on commit 6d449cc

Please sign in to comment.