On Tue, 15 Jan 2008 09:47:53 -0800
Stephen Hemminger <[EMAIL PROTECTED]> wrote:
> This is how I did it:
>
> --- a/net/ipv4/fib_trie.c 2008-01-15 09:14:53.000000000 -0800
> +++ b/net/ipv4/fib_trie.c 2008-01-15 09:21:48.000000000 -0800
> @@ -101,13 +101,6 @@ struct node {
> t_key key;
> };
>
> -struct leaf {
> - unsigned long parent;
> - t_key key;
> - struct hlist_head list;
> - struct rcu_head rcu;
> -};
> -
> struct leaf_info {
> struct hlist_node hlist;
> struct rcu_head rcu;
> @@ -115,6 +108,13 @@ struct leaf_info {
> struct list_head falh;
> };
>
> +struct leaf {
> + unsigned long parent;
> + t_key key;
> + struct hlist_head list;
> + struct rcu_head rcu;
> +};
I like this :)
Your design is clean, but we waste some space (rcu in leaf_info "included"), we
probably can do a litle bit better
(moving rcu at the end of leaf_info, and kmem_cache_create("ip_fib_trie",
sizeof(struct leaf) + sizeof(struct_leaf_info) - sizeof(struct rcu_head))
> - trie_leaf_kmem = kmem_cache_create("ip_fib_trie", sizeof(struct leaf),
> + trie_leaf_kmem = kmem_cache_create("ip_fib_trie",
> + sizeof(struct leaf) + sizeof(struct
> leaf_info),
> 0, SLAB_PANIC, NULL);
> }
>
>
Thank you
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html