WukLab / LITE

LITE Kernel RDMA Support for Datacenter Applications. SOSP 2017.
106 stars 19 forks source link

the parameter of hash_for_each_possible_rcu #8

Closed bueryg closed 5 years ago

bueryg commented 6 years ago

when I look into the source code , I am confused about the parameter of hash_for_each_possible_rcu in function client_add_askmr_table, there is one line code like this: hash_for_each_possible_rcu ( ADD_ASKMR_TABLE_HASHTABLE , current_hash_ptr, hlist , bucket) there are 4 parameters the definition of hash_for_each_possible_rcu is:

define hash_for_each_possible_rcu(name, obj, node, member, key) \

hlist_for_each_entry_rcu(obj, node, &name[hash_min(key, HASH_BITS(name))], member)

there are 5 parameters and the definition of hlist_for_each_entry_rcu is:

define hlist_for_each_entry_rcu(pos, head, member) \

for (pos = hlist_entry_safe (rcu_dereference_raw(hlist_first_rcu(head)),\
        typeof(*(pos)), member);            \
    pos;                            \
    pos = hlist_entry_safe(rcu_dereference_raw(hlist_next_rcu(\
        &(pos)->member)), typeof(*(pos)), member))

there are only 3 parameters

shinyehtsai commented 6 years ago

Under my header file is, hash_for_each_possible_rcu(name, obj, member, key) I think you could find header related information through https://elixir.bootlin.com/linux/v3.11.1/source/include/linux/hashtable.h#L172 I quote 3.11.1 since LITE used 3.11.1. But you could also find the same definition in the later kernel versions https://elixir.bootlin.com/linux/v4.17-rc1/source/include/linux/hashtable.h#L176 This website provides different kernel versions' source code. Hope this helps.