Skip to content

Commit

Permalink
[net/9p] unconditional wake_up to proc waiting for space on VirtIO ring
Browse files Browse the repository at this point in the history
Process may wait to get space on VirtIO ring to send a transaction to
VirtFS server. Current code just does a conditional wake_up() which
means only one process will be woken up even if multiple processes
are waiting.

This fix makes the wake_up unconditional. Hence we won't have any
processes waiting for-ever.

Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
  • Loading branch information
Venkateswararao Jujjuri (JV) authored and Eric Van Hensbergen committed Mar 22, 2011
1 parent 42869c8 commit 53bda3e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions net/9p/trans_virtio.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,10 @@ static void req_done(struct virtqueue *vq)
rc = virtqueue_get_buf(chan->vq, &len);

if (rc != NULL) {
if (!chan->ring_bufs_avail) {
chan->ring_bufs_avail = 1;
wake_up(chan->vc_wq);
}
chan->ring_bufs_avail = 1;
spin_unlock_irqrestore(&chan->lock, flags);
/* Wakeup if anyone waiting for VirtIO ring space. */
wake_up(chan->vc_wq);
P9_DPRINTK(P9_DEBUG_TRANS, ": rc %p\n", rc);
P9_DPRINTK(P9_DEBUG_TRANS, ": lookup tag %d\n",
rc->tag);
Expand Down

0 comments on commit 53bda3e

Please sign in to comment.