aboutsummaryrefslogtreecommitdiffstats
path: root/mm/mempolicy.c
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2005-10-29 21:15:49 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-10-30 00:40:35 -0400
commit662f3a0b94cc92bd708c27b80f8207cd7db93204 (patch)
treec7a42829efca15f7ccdcf510c80283f4c08e0343 /mm/mempolicy.c
parentdfcd3c0dc426bb75770c34b40e14f2da8845ea62 (diff)
[PATCH] Remove near all BUGs in mm/mempolicy.c
Most of them can never be triggered and were only for development. Signed-off-by: "Andi Kleen" <ak@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm/mempolicy.c')
-rw-r--r--mm/mempolicy.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 8bc0be1c9efd..43b1199af591 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -185,7 +185,6 @@ static struct zonelist *bind_zonelist(nodemask_t *nodes)
185 policy_zone = k; 185 policy_zone = k;
186 } 186 }
187 } 187 }
188 BUG_ON(num >= max);
189 zl->zones[num] = NULL; 188 zl->zones[num] = NULL;
190 return zl; 189 return zl;
191} 190}
@@ -709,7 +708,6 @@ static unsigned interleave_nodes(struct mempolicy *policy)
709 struct task_struct *me = current; 708 struct task_struct *me = current;
710 709
711 nid = me->il_next; 710 nid = me->il_next;
712 BUG_ON(nid >= MAX_NUMNODES);
713 next = next_node(nid, policy->v.nodes); 711 next = next_node(nid, policy->v.nodes);
714 if (next >= MAX_NUMNODES) 712 if (next >= MAX_NUMNODES)
715 next = first_node(policy->v.nodes); 713 next = first_node(policy->v.nodes);
@@ -731,18 +729,17 @@ static unsigned offset_il_node(struct mempolicy *pol,
731 nid = next_node(nid, pol->v.nodes); 729 nid = next_node(nid, pol->v.nodes);
732 c++; 730 c++;
733 } while (c <= target); 731 } while (c <= target);
734 BUG_ON(nid >= MAX_NUMNODES);
735 return nid; 732 return nid;
736} 733}
737 734
738/* Allocate a page in interleaved policy. 735/* Allocate a page in interleaved policy.
739 Own path because it needs to do special accounting. */ 736 Own path because it needs to do special accounting. */
740static struct page *alloc_page_interleave(gfp_t gfp, unsigned order, unsigned nid) 737static struct page *alloc_page_interleave(gfp_t gfp, unsigned order,
738 unsigned nid)
741{ 739{
742 struct zonelist *zl; 740 struct zonelist *zl;
743 struct page *page; 741 struct page *page;
744 742
745 BUG_ON(!node_online(nid));
746 zl = NODE_DATA(nid)->node_zonelists + gfp_zone(gfp); 743 zl = NODE_DATA(nid)->node_zonelists + gfp_zone(gfp);
747 page = __alloc_pages(gfp, order, zl); 744 page = __alloc_pages(gfp, order, zl);
748 if (page && page_zone(page) == zl->zones[0]) { 745 if (page && page_zone(page) == zl->zones[0]) {
@@ -785,8 +782,6 @@ alloc_page_vma(gfp_t gfp, struct vm_area_struct *vma, unsigned long addr)
785 unsigned nid; 782 unsigned nid;
786 if (vma) { 783 if (vma) {
787 unsigned long off; 784 unsigned long off;
788 BUG_ON(addr >= vma->vm_end);
789 BUG_ON(addr < vma->vm_start);
790 off = vma->vm_pgoff; 785 off = vma->vm_pgoff;
791 off += (addr - vma->vm_start) >> PAGE_SHIFT; 786 off += (addr - vma->vm_start) >> PAGE_SHIFT;
792 nid = offset_il_node(pol, vma, off); 787 nid = offset_il_node(pol, vma, off);