Shuffle netgraph mutexes a bit and hold a reference on a node
from the function that is calling the destructor.
This commit is contained in:
parent
1d9153d7ad
commit
a96dcd84d2
sys
@ -920,6 +920,8 @@ static char *spin_order_list[] = {
|
|||||||
#ifdef __i386__
|
#ifdef __i386__
|
||||||
"cy",
|
"cy",
|
||||||
#endif
|
#endif
|
||||||
|
"ng_node",
|
||||||
|
"ng_worklist",
|
||||||
"ithread table lock",
|
"ithread table lock",
|
||||||
"ithread list lock",
|
"ithread list lock",
|
||||||
"sched lock",
|
"sched lock",
|
||||||
@ -930,8 +932,6 @@ static char *spin_order_list[] = {
|
|||||||
/*
|
/*
|
||||||
* leaf locks
|
* leaf locks
|
||||||
*/
|
*/
|
||||||
"ng_node",
|
|
||||||
"ng_worklist",
|
|
||||||
#ifdef SMP
|
#ifdef SMP
|
||||||
#ifdef __i386__
|
#ifdef __i386__
|
||||||
"ap boot",
|
"ap boot",
|
||||||
|
@ -920,6 +920,8 @@ static char *spin_order_list[] = {
|
|||||||
#ifdef __i386__
|
#ifdef __i386__
|
||||||
"cy",
|
"cy",
|
||||||
#endif
|
#endif
|
||||||
|
"ng_node",
|
||||||
|
"ng_worklist",
|
||||||
"ithread table lock",
|
"ithread table lock",
|
||||||
"ithread list lock",
|
"ithread list lock",
|
||||||
"sched lock",
|
"sched lock",
|
||||||
@ -930,8 +932,6 @@ static char *spin_order_list[] = {
|
|||||||
/*
|
/*
|
||||||
* leaf locks
|
* leaf locks
|
||||||
*/
|
*/
|
||||||
"ng_node",
|
|
||||||
"ng_worklist",
|
|
||||||
#ifdef SMP
|
#ifdef SMP
|
||||||
#ifdef __i386__
|
#ifdef __i386__
|
||||||
"ap boot",
|
"ap boot",
|
||||||
|
@ -920,6 +920,8 @@ static char *spin_order_list[] = {
|
|||||||
#ifdef __i386__
|
#ifdef __i386__
|
||||||
"cy",
|
"cy",
|
||||||
#endif
|
#endif
|
||||||
|
"ng_node",
|
||||||
|
"ng_worklist",
|
||||||
"ithread table lock",
|
"ithread table lock",
|
||||||
"ithread list lock",
|
"ithread list lock",
|
||||||
"sched lock",
|
"sched lock",
|
||||||
@ -930,8 +932,6 @@ static char *spin_order_list[] = {
|
|||||||
/*
|
/*
|
||||||
* leaf locks
|
* leaf locks
|
||||||
*/
|
*/
|
||||||
"ng_node",
|
|
||||||
"ng_worklist",
|
|
||||||
#ifdef SMP
|
#ifdef SMP
|
||||||
#ifdef __i386__
|
#ifdef __i386__
|
||||||
"ap boot",
|
"ap boot",
|
||||||
|
@ -3269,13 +3269,13 @@ ngintr(void)
|
|||||||
item = ng_dequeue(&node->nd_input_queue);
|
item = ng_dequeue(&node->nd_input_queue);
|
||||||
if (item == NULL) {
|
if (item == NULL) {
|
||||||
mtx_unlock_spin(&node->nd_input_queue.q_mtx);
|
mtx_unlock_spin(&node->nd_input_queue.q_mtx);
|
||||||
NG_NODE_UNREF(node);
|
|
||||||
break; /* go look for another node */
|
break; /* go look for another node */
|
||||||
} else {
|
} else {
|
||||||
mtx_unlock_spin(&node->nd_input_queue.q_mtx);
|
mtx_unlock_spin(&node->nd_input_queue.q_mtx);
|
||||||
ng_apply_item(item);
|
ng_apply_item(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
NG_NODE_UNREF(node);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3544,7 +3544,8 @@ ng_send_fn(node_p node, hook_p hook, ng_item_fn *fn, void * arg1, int arg2)
|
|||||||
return (ENOMEM);
|
return (ENOMEM);
|
||||||
}
|
}
|
||||||
item->el_flags = NGQF_FN | NGQF_WRITER;
|
item->el_flags = NGQF_FN | NGQF_WRITER;
|
||||||
NG_NODE_REF(node);
|
NG_NODE_REF(node); /* One for us */
|
||||||
|
NG_NODE_REF(node); /* and one for the item */
|
||||||
NGI_SET_NODE(item, node);
|
NGI_SET_NODE(item, node);
|
||||||
if (hook) {
|
if (hook) {
|
||||||
NG_HOOK_REF(hook);
|
NG_HOOK_REF(hook);
|
||||||
@ -3554,6 +3555,7 @@ ng_send_fn(node_p node, hook_p hook, ng_item_fn *fn, void * arg1, int arg2)
|
|||||||
NGI_ARG1(item) = arg1;
|
NGI_ARG1(item) = arg1;
|
||||||
NGI_ARG2(item) = arg2;
|
NGI_ARG2(item) = arg2;
|
||||||
return (ng_snd_item(item, 0));
|
return (ng_snd_item(item, 0));
|
||||||
|
NG_NODE_UNREF(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user