aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2007-07-16 02:38:16 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-16 12:05:36 -0400
commit140d5a49046b6d73dce4a4229e88c000a99ee126 (patch)
tree64dcfe28ef6f5ccee5a2722e5c332c66ded29e28 /mm
parent462e00cc7151ed91fba688594436c453c80efb5d (diff)
numa: mempolicy: trivial debug fixes.
Enabling debugging fails to build due to the nodemask variable in do_mbind() having changed names, and then oopses on boot due to the assumption that the nodemask can be dereferenced -- which doesn't work out so well when the policy is changed to MPOL_DEFAULT with a NULL nodemask by numa_default_policy(). This fixes it up, and switches from PDprintk() to pr_debug() while we're at it. Signed-off-by: Paul Mundt <lethal@linux-sh.org> Cc: Christoph Lameter <clameter@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/mempolicy.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index a67c8f1828ac..188f8d9c4aed 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -101,8 +101,6 @@
101static struct kmem_cache *policy_cache; 101static struct kmem_cache *policy_cache;
102static struct kmem_cache *sn_cache; 102static struct kmem_cache *sn_cache;
103 103
104#define PDprintk(fmt...)
105
106/* Highest zone. An specific allocation for a zone below that is not 104/* Highest zone. An specific allocation for a zone below that is not
107 policied. */ 105 policied. */
108enum zone_type policy_zone = 0; 106enum zone_type policy_zone = 0;
@@ -175,7 +173,9 @@ static struct mempolicy *mpol_new(int mode, nodemask_t *nodes)
175{ 173{
176 struct mempolicy *policy; 174 struct mempolicy *policy;
177 175
178 PDprintk("setting mode %d nodes[0] %lx\n", mode, nodes_addr(*nodes)[0]); 176 pr_debug("setting mode %d nodes[0] %lx\n",
177 mode, nodes ? nodes_addr(*nodes)[0] : -1);
178
179 if (mode == MPOL_DEFAULT) 179 if (mode == MPOL_DEFAULT)
180 return NULL; 180 return NULL;
181 policy = kmem_cache_alloc(policy_cache, GFP_KERNEL); 181 policy = kmem_cache_alloc(policy_cache, GFP_KERNEL);
@@ -379,7 +379,7 @@ static int policy_vma(struct vm_area_struct *vma, struct mempolicy *new)
379 int err = 0; 379 int err = 0;
380 struct mempolicy *old = vma->vm_policy; 380 struct mempolicy *old = vma->vm_policy;
381 381
382 PDprintk("vma %lx-%lx/%lx vm_ops %p vm_file %p set_policy %p\n", 382 pr_debug("vma %lx-%lx/%lx vm_ops %p vm_file %p set_policy %p\n",
383 vma->vm_start, vma->vm_end, vma->vm_pgoff, 383 vma->vm_start, vma->vm_end, vma->vm_pgoff,
384 vma->vm_ops, vma->vm_file, 384 vma->vm_ops, vma->vm_file,
385 vma->vm_ops ? vma->vm_ops->set_policy : NULL); 385 vma->vm_ops ? vma->vm_ops->set_policy : NULL);
@@ -776,8 +776,8 @@ long do_mbind(unsigned long start, unsigned long len,
776 if (!new) 776 if (!new)
777 flags |= MPOL_MF_DISCONTIG_OK; 777 flags |= MPOL_MF_DISCONTIG_OK;
778 778
779 PDprintk("mbind %lx-%lx mode:%ld nodes:%lx\n",start,start+len, 779 pr_debug("mbind %lx-%lx mode:%ld nodes:%lx\n",start,start+len,
780 mode,nodes_addr(nodes)[0]); 780 mode, nmask ? nodes_addr(*nmask)[0] : -1);
781 781
782 down_write(&mm->mmap_sem); 782 down_write(&mm->mmap_sem);
783 vma = check_range(mm, start, end, nmask, 783 vma = check_range(mm, start, end, nmask,
@@ -1434,7 +1434,7 @@ static void sp_insert(struct shared_policy *sp, struct sp_node *new)
1434 } 1434 }
1435 rb_link_node(&new->nd, parent, p); 1435 rb_link_node(&new->nd, parent, p);
1436 rb_insert_color(&new->nd, &sp->root); 1436 rb_insert_color(&new->nd, &sp->root);
1437 PDprintk("inserting %lx-%lx: %d\n", new->start, new->end, 1437 pr_debug("inserting %lx-%lx: %d\n", new->start, new->end,
1438 new->policy ? new->policy->policy : 0); 1438 new->policy ? new->policy->policy : 0);
1439} 1439}
1440 1440
@@ -1459,7 +1459,7 @@ mpol_shared_policy_lookup(struct shared_policy *sp, unsigned long idx)
1459 1459
1460static void sp_delete(struct shared_policy *sp, struct sp_node *n) 1460static void sp_delete(struct shared_policy *sp, struct sp_node *n)
1461{ 1461{
1462 PDprintk("deleting %lx-l%x\n", n->start, n->end); 1462 pr_debug("deleting %lx-l%lx\n", n->start, n->end);
1463 rb_erase(&n->nd, &sp->root); 1463 rb_erase(&n->nd, &sp->root);
1464 mpol_free(n->policy); 1464 mpol_free(n->policy);
1465 kmem_cache_free(sn_cache, n); 1465 kmem_cache_free(sn_cache, n);
@@ -1558,10 +1558,10 @@ int mpol_set_shared_policy(struct shared_policy *info,
1558 struct sp_node *new = NULL; 1558 struct sp_node *new = NULL;
1559 unsigned long sz = vma_pages(vma); 1559 unsigned long sz = vma_pages(vma);
1560 1560
1561 PDprintk("set_shared_policy %lx sz %lu %d %lx\n", 1561 pr_debug("set_shared_policy %lx sz %lu %d %lx\n",
1562 vma->vm_pgoff, 1562 vma->vm_pgoff,
1563 sz, npol? npol->policy : -1, 1563 sz, npol? npol->policy : -1,
1564 npol ? nodes_addr(npol->v.nodes)[0] : -1); 1564 npol ? nodes_addr(npol->v.nodes)[0] : -1);
1565 1565
1566 if (npol) { 1566 if (npol) {
1567 new = sp_alloc(vma->vm_pgoff, vma->vm_pgoff + sz, npol); 1567 new = sp_alloc(vma->vm_pgoff, vma->vm_pgoff + sz, npol);