]> git.proxmox.com Git - mirror_lxcfs.git/commit
Use hash table to store load information
authorzhang2639 <zhangshiqiang@hust.edu.cn>
Thu, 24 May 2018 10:27:34 +0000 (18:27 +0800)
committerzhang2639 <zhangshiqiang@hust.edu.cn>
Thu, 24 May 2018 10:27:34 +0000 (18:27 +0800)
commit0e47acaa3d3131ff07fe8b37fb3bc839dbc3279e
treef54e5ff0089d8f1ea6f3d877cda54a2b5ccd6a91
parent46be8eed15b6d020ec68051a5579412f4e5fdd02
Use hash table to store load information

struct load_head{} contains three locks for thread synchronization
and a pointer to the hash list.
struct load_node{} contains special information of container and
pointers to the hash node.
static struct load_head *load_hash[LOAD_SIZE] is hash table.
calc_hash : get the hash of a special container.
init_load : initialize hash table.
insert_node : insert a container node to the hash table.
locate_node : find the specital container node.
del_node : delete a specital container node and return the next node
of it.

Signed-off-by: zhang2639 <zhangshiqiang@hust.edu.cn>
Signed-off-by: yuwang <yuwang@linux.alibaba.com>
bindings.c