Init xns::percore and xns::percore_lock

上级 07cad277
...@@ -52,6 +52,7 @@ struct klockstat; ...@@ -52,6 +52,7 @@ struct klockstat;
#define LOCKSTAT_KALLOC 1 #define LOCKSTAT_KALLOC 1
#define LOCKSTAT_KMALLOC 1 #define LOCKSTAT_KMALLOC 1
#define LOCKSTAT_NET 1 #define LOCKSTAT_NET 1
#define LOCKSTAT_NS 1
#define LOCKSTAT_PIPE 1 #define LOCKSTAT_PIPE 1
#define LOCKSTAT_PROC 1 #define LOCKSTAT_PROC 1
#define LOCKSTAT_SCHED 1 #define LOCKSTAT_SCHED 1
......
...@@ -56,6 +56,10 @@ class xns : public rcu_freed { ...@@ -56,6 +56,10 @@ class xns : public rcu_freed {
nextkey = 1; nextkey = 1;
for (int i = 0; i < NHASH; i++) for (int i = 0; i < NHASH; i++)
table[i].chain = 0; table[i].chain = 0;
for (int i = 0; i < NCPU; i++) {
percore[i] = nullptr;
initlock(&percore_lock[i], "xns_lock", LOCKSTAT_NS);
}
} }
~xns() { ~xns() {
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论