[PATCH] Undo mempolicy shared policy rbtree microoptimization
[linux-2.6.git] / mm / mempolicy.c
index cb41c31e7c875873f96a5c6d24ab91ab17d3311c..1694845526be5db9c18ef0183110435a0ccf9ab7 100644 (file)
@@ -1138,11 +1138,11 @@ void mpol_free_shared_policy(struct shared_policy *p)
        while (next) {
                n = rb_entry(next, struct sp_node, nd);
                next = rb_next(&n->nd);
+               rb_erase(&n->nd, &p->root);
                mpol_free(n->policy);
                kmem_cache_free(sn_cache, n);
        }
        spin_unlock(&p->lock);
-       p->root = RB_ROOT;
 }
 
 /* assumes fs == KERNEL_DS */