[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20141222.133353.2244861758408916536.davem@davemloft.net>
Date: Mon, 22 Dec 2014 13:33:53 -0500 (EST)
From: David Miller <davem@...emloft.net>
To: alexander.h.duyck@...hat.com
Cc: netdev@...r.kernel.org
Subject: Re: [RFC PATCH 02/17] fib_trie: Make leaf and tnode more uniform
From: Alexander Duyck <alexander.h.duyck@...hat.com>
Date: Mon, 22 Dec 2014 09:41:05 -0800
> -#define IS_TNODE(n) (!(n->parent & T_LEAF))
> -#define IS_LEAF(n) (n->parent & T_LEAF)
> +struct tnode {
> + t_key key;
> + unsigned char bits; /* 2log(KEYLENGTH) bits needed */
> + unsigned char pos; /* 2log(KEYLENGTH) bits needed */
> + struct tnode __rcu *parent;
> + union {
> + struct rcu_head rcu;
> + struct tnode *tnode_free;
> + };
> + unsigned int full_children; /* KEYLENGTH bits needed */
> + unsigned int empty_children; /* KEYLENGTH bits needed */
> + struct rt_trie_node __rcu *child[0];
> +};
I wonder if we can compress this even further.
The full_children and empty_children can probably both be a u16, right?
If so, you can stick at least one of them after 'bits' and 'pos' and
thus save 4 bytes on 32b.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists