Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 33769
b: refs/heads/master
c: 3b98b08
h: refs/heads/master
i:
  33767: f5a1de8
v: v3
  • Loading branch information
Nishanth Aravamudan authored and Linus Torvalds committed Sep 1, 2006
1 parent ae77474 commit 8b7f79f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 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: 1678df37be8abbb381becdc40242ed915e775550
refs/heads/master: 3b98b087fc2daab67518d2baa8aef19a6ad82723
10 changes: 9 additions & 1 deletion trunk/mm/mempolicy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1176,7 +1176,15 @@ static inline unsigned interleave_nid(struct mempolicy *pol,
if (vma) {
unsigned long off;

off = vma->vm_pgoff;
/*
* for small pages, there is no difference between
* shift and PAGE_SHIFT, so the bit-shift is safe.
* for huge pages, since vm_pgoff is in units of small
* pages, we need to shift off the always 0 bits to get
* a useful offset.
*/
BUG_ON(shift < PAGE_SHIFT);
off = vma->vm_pgoff >> (shift - PAGE_SHIFT);
off += (addr - vma->vm_start) >> shift;
return offset_il_node(pol, vma, off);
} else
Expand Down

0 comments on commit 8b7f79f

Please sign in to comment.