Wait in 'S' state when send/recv pipe is blocking

Reviewed-by: Paul Dagnelie <pcd@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: DHE <git@dehacked.net>
Closes #8733 
Closes #8752
This commit is contained in:
DeHackEd 2019-06-03 23:54:43 -04:00 committed by Brian Behlendorf
parent 11ad06d1d8
commit 58b2de6420
1 changed files with 2 additions and 2 deletions

View File

@ -73,7 +73,7 @@ bqueue_enqueue(bqueue_t *q, void *data, uint64_t item_size)
mutex_enter(&q->bq_lock); mutex_enter(&q->bq_lock);
obj2node(q, data)->bqn_size = item_size; obj2node(q, data)->bqn_size = item_size;
while (q->bq_size + item_size > q->bq_maxsize) { while (q->bq_size + item_size > q->bq_maxsize) {
cv_wait(&q->bq_add_cv, &q->bq_lock); cv_wait_sig(&q->bq_add_cv, &q->bq_lock);
} }
q->bq_size += item_size; q->bq_size += item_size;
list_insert_tail(&q->bq_list, data); list_insert_tail(&q->bq_list, data);
@ -91,7 +91,7 @@ bqueue_dequeue(bqueue_t *q)
uint64_t item_size; uint64_t item_size;
mutex_enter(&q->bq_lock); mutex_enter(&q->bq_lock);
while (q->bq_size == 0) { while (q->bq_size == 0) {
cv_wait(&q->bq_pop_cv, &q->bq_lock); cv_wait_sig(&q->bq_pop_cv, &q->bq_lock);
} }
ret = list_remove_head(&q->bq_list); ret = list_remove_head(&q->bq_list);
ASSERT3P(ret, !=, NULL); ASSERT3P(ret, !=, NULL);