[ltt-dev] [PATCH 5/9] use random value for hash value directly

Lai Jiangshan laijs at cn.fujitsu.com
Wed Nov 16 03:41:53 EST 2011


On 11/15/2011 07:20 PM, Mathieu Desnoyers wrote:
> * Lai Jiangshan (laijs at cn.fujitsu.com) wrote:
> [...]
>>  struct lfht_test_node {
>>  	struct cds_lfht_node node;
>> -	void *key;
>> -	unsigned int key_len;
>> +	unsigned long hash;
>>  	/* cache-cold for iteration */
>>  	struct rcu_head head;
> 
> I'm really unsure about this. 


The key is just a black box for a hash table.
hash table focus on hash value mainly, so we can use random value for
hash value when testing if the random values are good(very random).


> One of the test-case should be to walk
> through identical-hash-value-chain and find the right node by matching
> its key. If we make the hash equal to the key, we don't test the "match"
> code anymore.
> 

there is no duplicated key/node for this patch.




More information about the lttng-dev mailing list