Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 93981
b: refs/heads/master
c: 0e88460
h: refs/heads/master
i:
  93979: eb868cb
v: v3
  • Loading branch information
Mel Gorman authored and Linus Torvalds committed Apr 28, 2008
1 parent 2b41b64 commit f0b2036
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 18 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: dac1d27bc8d5ca636d3014ecfdf94407031d1970
refs/heads/master: 0e88460da6ab7bb6a7ef83675412ed5b6315d741
3 changes: 1 addition & 2 deletions trunk/drivers/char/sysrq.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,7 @@ static struct sysrq_key_op sysrq_term_op = {

static void moom_callback(struct work_struct *ignored)
{
out_of_memory(&NODE_DATA(0)->node_zonelists[ZONE_NORMAL],
GFP_KERNEL, 0);
out_of_memory(node_zonelist(0, GFP_KERNEL), GFP_KERNEL, 0);
}

static DECLARE_WORK(moom_work, moom_callback);
Expand Down
6 changes: 3 additions & 3 deletions trunk/fs/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,13 +361,13 @@ void invalidate_bdev(struct block_device *bdev)
static void free_more_memory(void)
{
struct zonelist *zonelist;
pg_data_t *pgdat;
int nid;

wakeup_pdflush(1024);
yield();

for_each_online_pgdat(pgdat) {
zonelist = &pgdat->node_zonelists[gfp_zone(GFP_NOFS)];
for_each_online_node(nid) {
zonelist = node_zonelist(nid, GFP_NOFS);
if (zonelist->zones[0])
try_to_free_pages(zonelist, 0, GFP_NOFS);
}
Expand Down
8 changes: 6 additions & 2 deletions trunk/include/linux/gfp.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,15 @@ static inline enum zone_type gfp_zone(gfp_t flags)
/*
* We get the zone list from the current node and the gfp_mask.
* This zone list contains a maximum of MAXNODES*MAX_NR_ZONES zones.
* There are many zonelists per node, two for each active zone.
*
* For the normal case of non-DISCONTIGMEM systems the NODE_DATA() gets
* optimized to &contig_page_data at compile-time.
*/
static inline struct zonelist *node_zonelist(int nid, gfp_t flags)
{
return NODE_DATA(nid)->node_zonelists + gfp_zone(flags);
}

#ifndef HAVE_ARCH_FREE_PAGE
static inline void arch_free_page(struct page *page, int order) { }
Expand All @@ -178,8 +183,7 @@ static inline struct page *alloc_pages_node(int nid, gfp_t gfp_mask,
if (nid < 0)
nid = numa_node_id();

return __alloc_pages(gfp_mask, order,
NODE_DATA(nid)->node_zonelists + gfp_zone(gfp_mask));
return __alloc_pages(gfp_mask, order, node_zonelist(nid, gfp_mask));
}

#ifdef CONFIG_NUMA
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/mempolicy.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ static inline void mpol_fix_fork_child_flag(struct task_struct *p)
static inline struct zonelist *huge_zonelist(struct vm_area_struct *vma,
unsigned long addr, gfp_t gfp_flags, struct mempolicy **mpol)
{
return NODE_DATA(0)->node_zonelists + gfp_zone(gfp_flags);
return node_zonelist(0, gfp_flags);
}

static inline int do_migrate_pages(struct mm_struct *mm,
Expand Down
6 changes: 3 additions & 3 deletions trunk/mm/mempolicy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1183,7 +1183,7 @@ static struct zonelist *zonelist_policy(gfp_t gfp, struct mempolicy *policy)
nd = 0;
BUG();
}
return NODE_DATA(nd)->node_zonelists + gfp_zone(gfp);
return node_zonelist(nd, gfp);
}

/* Do dynamic interleaving for a process */
Expand Down Expand Up @@ -1299,7 +1299,7 @@ struct zonelist *huge_zonelist(struct vm_area_struct *vma, unsigned long addr,
if (unlikely(pol != &default_policy &&
pol != current->mempolicy))
__mpol_free(pol); /* finished with pol */
return NODE_DATA(nid)->node_zonelists + gfp_zone(gfp_flags);
return node_zonelist(nid, gfp_flags);
}

zl = zonelist_policy(GFP_HIGHUSER, pol);
Expand All @@ -1321,7 +1321,7 @@ static struct page *alloc_page_interleave(gfp_t gfp, unsigned order,
struct zonelist *zl;
struct page *page;

zl = NODE_DATA(nid)->node_zonelists + gfp_zone(gfp);
zl = node_zonelist(nid, gfp);
page = __alloc_pages(gfp, order, zl);
if (page && page_zone(page) == zl->zones[0])
inc_zone_page_state(page, NUMA_INTERLEAVE_HIT);
Expand Down
3 changes: 1 addition & 2 deletions trunk/mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1713,10 +1713,9 @@ EXPORT_SYMBOL(free_pages);
static unsigned int nr_free_zone_pages(int offset)
{
/* Just pick one node, since fallback list is circular */
pg_data_t *pgdat = NODE_DATA(numa_node_id());
unsigned int sum = 0;

struct zonelist *zonelist = pgdat->node_zonelists + offset;
struct zonelist *zonelist = node_zonelist(numa_node_id(), GFP_KERNEL);
struct zone **zonep = zonelist->zones;
struct zone *zone;

Expand Down
3 changes: 1 addition & 2 deletions trunk/mm/slab.c
Original file line number Diff line number Diff line change
Expand Up @@ -3249,8 +3249,7 @@ static void *fallback_alloc(struct kmem_cache *cache, gfp_t flags)
if (flags & __GFP_THISNODE)
return NULL;

zonelist = &NODE_DATA(slab_node(current->mempolicy))
->node_zonelists[gfp_zone(flags)];
zonelist = node_zonelist(slab_node(current->mempolicy), flags);
local_flags = flags & (GFP_CONSTRAINT_MASK|GFP_RECLAIM_MASK);

retry:
Expand Down
3 changes: 1 addition & 2 deletions trunk/mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -1309,8 +1309,7 @@ static struct page *get_any_partial(struct kmem_cache *s, gfp_t flags)
get_cycles() % 1024 > s->remote_node_defrag_ratio)
return NULL;

zonelist = &NODE_DATA(
slab_node(current->mempolicy))->node_zonelists[gfp_zone(flags)];
zonelist = node_zonelist(slab_node(current->mempolicy), flags);
for (z = zonelist->zones; *z; z++) {
struct kmem_cache_node *n;

Expand Down

0 comments on commit f0b2036

Please sign in to comment.