Skip to content

Commit 51ffeab

Browse files
repkmartinetd
authored andcommitted
9p: Track 9P RPC waiting time as IO
Use io_wait_event_killable() to ensure that time spent waiting for 9P RPC transactions is accounted as IO wait time. Signed-off-by: Remi Pommarel <repk@triplefau.lt> Message-ID: <b8601271263011203fa34eada2e8ac21d9f679e5.1769179462.git.repk@triplefau.lt> Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
1 parent ca136b2 commit 51ffeab

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

net/9p/client.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -590,8 +590,8 @@ p9_client_rpc(struct p9_client *c, int8_t type, const char *fmt, ...)
590590
}
591591
again:
592592
/* Wait for the response */
593-
err = wait_event_killable(req->wq,
594-
READ_ONCE(req->status) >= REQ_STATUS_RCVD);
593+
err = io_wait_event_killable(req->wq,
594+
READ_ONCE(req->status) >= REQ_STATUS_RCVD);
595595

596596
/* Make sure our req is coherent with regard to updates in other
597597
* threads - echoes to wmb() in the callback

net/9p/trans_virtio.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,8 @@ p9_virtio_request(struct p9_client *client, struct p9_req_t *req)
284284
if (err == -ENOSPC) {
285285
chan->ring_bufs_avail = 0;
286286
spin_unlock_irqrestore(&chan->lock, flags);
287-
err = wait_event_killable(*chan->vc_wq,
288-
chan->ring_bufs_avail);
287+
err = io_wait_event_killable(*chan->vc_wq,
288+
chan->ring_bufs_avail);
289289
if (err == -ERESTARTSYS)
290290
return err;
291291

@@ -325,7 +325,7 @@ static int p9_get_mapped_pages(struct virtio_chan *chan,
325325
* Other zc request to finish here
326326
*/
327327
if (atomic_read(&vp_pinned) >= chan->p9_max_pages) {
328-
err = wait_event_killable(vp_wq,
328+
err = io_wait_event_killable(vp_wq,
329329
(atomic_read(&vp_pinned) < chan->p9_max_pages));
330330
if (err == -ERESTARTSYS)
331331
return err;
@@ -512,8 +512,8 @@ p9_virtio_zc_request(struct p9_client *client, struct p9_req_t *req,
512512
if (err == -ENOSPC) {
513513
chan->ring_bufs_avail = 0;
514514
spin_unlock_irqrestore(&chan->lock, flags);
515-
err = wait_event_killable(*chan->vc_wq,
516-
chan->ring_bufs_avail);
515+
err = io_wait_event_killable(*chan->vc_wq,
516+
chan->ring_bufs_avail);
517517
if (err == -ERESTARTSYS)
518518
goto err_out;
519519

@@ -531,8 +531,8 @@ p9_virtio_zc_request(struct p9_client *client, struct p9_req_t *req,
531531
spin_unlock_irqrestore(&chan->lock, flags);
532532
kicked = 1;
533533
p9_debug(P9_DEBUG_TRANS, "virtio request kicked\n");
534-
err = wait_event_killable(req->wq,
535-
READ_ONCE(req->status) >= REQ_STATUS_RCVD);
534+
err = io_wait_event_killable(req->wq,
535+
READ_ONCE(req->status) >= REQ_STATUS_RCVD);
536536
// RERROR needs reply (== error string) in static data
537537
if (READ_ONCE(req->status) == REQ_STATUS_RCVD &&
538538
unlikely(req->rc.sdata[4] == P9_RERROR))

net/9p/trans_xen.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ static int p9_xen_request(struct p9_client *client, struct p9_req_t *p9_req)
136136
ring = &priv->rings[num];
137137

138138
again:
139-
while (wait_event_killable(ring->wq,
140-
p9_xen_write_todo(ring, size)) != 0)
139+
while (io_wait_event_killable(ring->wq,
140+
p9_xen_write_todo(ring, size)) != 0)
141141
;
142142

143143
spin_lock_irqsave(&ring->lock, flags);

0 commit comments

Comments
 (0)