public inbox for [email protected]
 help / color / mirror / Atom feed
* Deduplicate io_*_prep calls?
@ 2020-02-24  1:07 Andres Freund
  2020-02-24  3:17 ` Jens Axboe
  0 siblings, 1 reply; 22+ messages in thread
From: Andres Freund @ 2020-02-24  1:07 UTC (permalink / raw)
  To: io-uring

Hi,

There's currently two places that know to call io_*_prep() for
sqes. io_req_defer_prep() and io_issue_sqe(). E.g. for READV there's:

static int io_req_defer_prep(struct io_kiocb *req,
			     const struct io_uring_sqe *sqe)
...
	case IORING_OP_READV:
	case IORING_OP_READ_FIXED:
	case IORING_OP_READ:
		ret = io_read_prep(req, sqe, true);
		break;

and

static int io_issue_sqe(struct io_kiocb *req, const struct io_uring_sqe *sqe,
			struct io_kiocb **nxt, bool force_nonblock)
{
...
	case IORING_OP_READV:
	case IORING_OP_READ_FIXED:
	case IORING_OP_READ:
		if (sqe) {
			ret = io_read_prep(req, sqe, force_nonblock);
			if (ret < 0)
				break;
		}
		ret = io_read(req, nxt, force_nonblock);
		break;

that seems a bit unnecessary. How about breaking that out into a
separate function?  I can write up a patch, just didn't want to do so if
there's a reason for the current split.


Alternatively it'd could all be just be dispatches via io_op_defs, but
that'd be a bigger change with potential performance implications. And
it'd benefit from prior deduplication anyway.

Greetings,

Andres Freund

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2020-02-27 21:06 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-24  1:07 Deduplicate io_*_prep calls? Andres Freund
2020-02-24  3:17 ` Jens Axboe
2020-02-24  3:33   ` Andres Freund
2020-02-24  3:52     ` Jens Axboe
2020-02-24  7:12       ` Andres Freund
2020-02-24  9:10         ` Pavel Begunkov
2020-02-24 15:40         ` Jens Axboe
2020-02-24 15:44           ` Pavel Begunkov
2020-02-24 15:46             ` Jens Axboe
2020-02-24 15:50               ` Pavel Begunkov
2020-02-24 15:53                 ` Jens Axboe
2020-02-24 15:56                   ` Pavel Begunkov
2020-02-24 16:02                     ` Jens Axboe
2020-02-24 16:18                       ` Pavel Begunkov
2020-02-24 17:08                         ` Andres Freund
2020-02-24 17:16                           ` Pavel Begunkov
2020-02-25  9:26                 ` Pavel Begunkov
2020-02-27 21:06                   ` Andres Freund
2020-02-24 16:53           ` Andres Freund
2020-02-24 17:19             ` Jens Axboe
2020-02-24 17:30               ` Jens Axboe
2020-02-24 17:37               ` Pavel Begunkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox