io-uring.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: Jens Axboe <axboe@kernel.dk>
Cc: Pavel Begunkov <asml.silence@gmail.com>, io-uring@vger.kernel.org
Subject: Re: liburing: expose syscalls?
Date: Sat, 1 Feb 2020 23:27:33 -0800	[thread overview]
Message-ID: <20200202072733.ioqdel36se2tgk3i@alap3.anarazel.de> (raw)
In-Reply-To: <502b2b01-d691-b7bf-53f1-e7a24fb4c6d9@kernel.dk>

Hi,

On 2020-02-01 20:29:39 -0700, Jens Axboe wrote:
> On 2/1/20 4:30 PM, Pavel Begunkov wrote:
> > On 02/02/2020 01:51, Jens Axboe wrote:
> >>>> So you just want to have them exposed? I'd be fine with that. I'll
> >>>> take a patch :-)
> >>>>
> >>>
> >>> Depends on how it's used, but I'd strive to inline
> >>> __sys_io_uring_enter() to remove the extra indirect call into the
> >>> shared lib. Though, not sure about packaging and all this stuff. May
> >>> be useful to do that for liburing as well.
> >>
> >> Not sure that actually matters when you're doing a syscall anyway, that
> >> should be the long pole for the operation.
> >>
> > 
> > Yeah, but they are starting to stack up (+syscall() from glibc) and can became
> > even more layered on the user side.
> 
> Not saying it's free, just that I expect the actual system call to dominate.
> But I hear what you are saying, this is exactly why the liburing hot path
> resides in static inline code, and doesn't require library calls. I did
> draw the line on anything that needs a system call, figuring that wasn't
> worth over-optimizing.

That is my intuition too, especially in my case where I'm "intending" to
block in the kernel. I just tried locally, and at least with storage (a
Samsung 970 pro NVMe, in my laptop) in the path, runtime differences are
below run to run noise, and the profile doesn't show any meaningful time
spent in the indirection.

I don't really see a reason not to move syscall.c functions into a
header however. Would allow the to remove the syscall() indirection
transparently once glibc gets around supporting the syscall too. Given
that it's essentially just kernel interface definitions, how about just
putting it into liburing/io_uring.h?

I'll open a PR.  If somebody wants to bikeshed on using a name other
than __sys_*...

Greetings,

Andres Freund

      reply	other threads:[~2020-02-02  7:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-01 12:53 liburing: expose syscalls? Andres Freund
2020-02-01 17:39 ` Jens Axboe
2020-02-01 17:49   ` Andres Freund
2020-02-01 17:52     ` Jens Axboe
2020-02-01 21:16       ` Pavel Begunkov
2020-02-01 22:51         ` Jens Axboe
2020-02-01 23:30           ` Pavel Begunkov
2020-02-02  3:29             ` Jens Axboe
2020-02-02  7:27               ` Andres Freund [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200202072733.ioqdel36se2tgk3i@alap3.anarazel.de \
    --to=andres@anarazel.de \
    --cc=asml.silence@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).