Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 139167
b: refs/heads/master
c: 327c0e9
h: refs/heads/master
i:
  139165: cb3ee2d
  139163: 7fe726d
  139159: 10d8ac5
  139151: 17ee7c4
  139135: 47b9a48
v: v3
  • Loading branch information
KAMEZAWA Hiroyuki authored and Linus Torvalds committed Apr 1, 2009
1 parent 1c0484a commit 6cd36fa
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 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: 2678958e1225f350806d90f211a3b475f64aee80
refs/heads/master: 327c0e968645f2601a43f5ea7c19c7b3a5fa0a34
2 changes: 1 addition & 1 deletion trunk/fs/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ static void free_more_memory(void)
&zone);
if (zone)
try_to_free_pages(node_zonelist(nid, GFP_NOFS), 0,
GFP_NOFS);
GFP_NOFS, NULL);
}
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/swap.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ static inline void lru_cache_add_active_file(struct page *page)

/* linux/mm/vmscan.c */
extern unsigned long try_to_free_pages(struct zonelist *zonelist, int order,
gfp_t gfp_mask);
gfp_t gfp_mask, nodemask_t *mask);
extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem,
gfp_t gfp_mask, bool noswap,
unsigned int swappiness);
Expand Down
3 changes: 2 additions & 1 deletion trunk/mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1582,7 +1582,8 @@ __alloc_pages_internal(gfp_t gfp_mask, unsigned int order,
reclaim_state.reclaimed_slab = 0;
p->reclaim_state = &reclaim_state;

did_some_progress = try_to_free_pages(zonelist, order, gfp_mask);
did_some_progress = try_to_free_pages(zonelist, order,
gfp_mask, nodemask);

p->reclaim_state = NULL;
lockdep_clear_current_reclaim_state();
Expand Down
13 changes: 11 additions & 2 deletions trunk/mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ struct scan_control {
/* Which cgroup do we reclaim from */
struct mem_cgroup *mem_cgroup;

/*
* Nodemask of nodes allowed by the caller. If NULL, all nodes
* are scanned.
*/
nodemask_t *nodemask;

/* Pluggable isolate pages callback */
unsigned long (*isolate_pages)(unsigned long nr, struct list_head *dst,
unsigned long *scanned, int order, int mode,
Expand Down Expand Up @@ -1538,7 +1544,8 @@ static void shrink_zones(int priority, struct zonelist *zonelist,
struct zone *zone;

sc->all_unreclaimable = 1;
for_each_zone_zonelist(zone, z, zonelist, high_zoneidx) {
for_each_zone_zonelist_nodemask(zone, z, zonelist, high_zoneidx,
sc->nodemask) {
if (!populated_zone(zone))
continue;
/*
Expand Down Expand Up @@ -1683,7 +1690,7 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist,
}

unsigned long try_to_free_pages(struct zonelist *zonelist, int order,
gfp_t gfp_mask)
gfp_t gfp_mask, nodemask_t *nodemask)
{
struct scan_control sc = {
.gfp_mask = gfp_mask,
Expand All @@ -1694,6 +1701,7 @@ unsigned long try_to_free_pages(struct zonelist *zonelist, int order,
.order = order,
.mem_cgroup = NULL,
.isolate_pages = isolate_pages_global,
.nodemask = nodemask,
};

return do_try_to_free_pages(zonelist, &sc);
Expand All @@ -1714,6 +1722,7 @@ unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem_cont,
.order = 0,
.mem_cgroup = mem_cont,
.isolate_pages = mem_cgroup_isolate_pages,
.nodemask = NULL, /* we don't care the placement */
};
struct zonelist *zonelist;

Expand Down

0 comments on commit 6cd36fa

Please sign in to comment.