Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 87087
b: refs/heads/master
c: 69682d8
h: refs/heads/master
i:
  87085: 6b38442
  87083: bd55192
  87079: 4796e66
  87071: aa37f3b
v: v3
  • Loading branch information
Lee Schermerhorn authored and Linus Torvalds committed Mar 11, 2008
1 parent c95bee7 commit f49b2b3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 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: 9afa802ff568d935dab33dd207dc25d9849f35d4
refs/heads/master: 69682d852f5c94ee94e21174b3e8b719626c98db
5 changes: 3 additions & 2 deletions trunk/ipc/shm.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,10 @@ static struct mempolicy *shm_get_policy(struct vm_area_struct *vma,

if (sfd->vm_ops->get_policy)
pol = sfd->vm_ops->get_policy(vma, addr);
else if (vma->vm_policy)
else if (vma->vm_policy) {
pol = vma->vm_policy;
else
mpol_get(pol); /* get_vma_policy() expects this */
} else
pol = current->mempolicy;
return pol;
}
Expand Down
7 changes: 6 additions & 1 deletion trunk/mm/mempolicy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1296,7 +1296,9 @@ struct zonelist *huge_zonelist(struct vm_area_struct *vma, unsigned long addr,
unsigned nid;

nid = interleave_nid(pol, vma, addr, HPAGE_SHIFT);
__mpol_free(pol); /* finished with pol */
if (unlikely(pol != &default_policy &&
pol != current->mempolicy))
__mpol_free(pol); /* finished with pol */
return NODE_DATA(nid)->node_zonelists + gfp_zone(gfp_flags);
}

Expand Down Expand Up @@ -1360,6 +1362,9 @@ alloc_page_vma(gfp_t gfp, struct vm_area_struct *vma, unsigned long addr)
unsigned nid;

nid = interleave_nid(pol, vma, addr, PAGE_SHIFT);
if (unlikely(pol != &default_policy &&
pol != current->mempolicy))
__mpol_free(pol); /* finished with pol */
return alloc_page_interleave(gfp, 0, nid);
}
zl = zonelist_policy(gfp, pol);
Expand Down

0 comments on commit f49b2b3

Please sign in to comment.