Re: Dropped patch: mm/mempolicy.c:sp_lookup()

From: Andi Kleen
Date: Thu Nov 18 2004 - 00:21:46 EST


> Some optimizations in mempolicy.c (like to avoid rebalancing the tree while
> destroying it and by breaking loops early and not checking for invariant
> conditions in the replace operation).

[...]
>
> diff -puN mm/mempolicy.c~mempolicy-optimization mm/mempolicy.c
> --- 25/mm/mempolicy.c~mempolicy-optimization 2004-11-17 12:26:40.149947024 -0800
> +++ 25-akpm/mm/mempolicy.c 2004-11-17 12:26:40.153946416 -0800
> @@ -1211,12 +1211,10 @@ restart:
> return -ENOMEM;
> goto restart;
> }
> - n->end = end;
> + n->end = start;
> sp_insert(sp, new2);
> - new2 = NULL;
> - }
> - /* Old crossing beginning, but not end (easy) */
> - if (n->start < start && n->end > start)
> + break;
> + } else
> n->end = start;
> }
> if (!next)

I'm not quite sure about this one.

> @@ -1270,11 +1268,11 @@ void mpol_free_shared_policy(struct shar
> 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;
> }

This hunk is fine.

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/