qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v6] Use io_uring_register_ring_fd() to skip fd operations


From: Stefan Hajnoczi
Subject: Re: [PATCH v6] Use io_uring_register_ring_fd() to skip fd operations
Date: Tue, 31 May 2022 12:50:25 +0100

On Tue, 31 May 2022 at 12:34, Sam Li <faithilikerun@gmail.com> wrote:
>
> Stefan Hajnoczi <stefanha@gmail.com> 于2022年5月31日周二 19:31写道:
> >
> > On Tue, May 31, 2022 at 06:50:11PM +0800, Sam Li wrote:
> > > Linux recently added a new io_uring(7) optimization API that QEMU
> > > doesn't take advantage of yet. The liburing library that QEMU uses
> > > has added a corresponding new API calling io_uring_register_ring_fd().
> > > When this API is called after creating the ring, the io_uring_submit()
> > > library function passes a flag to the io_uring_enter(2) syscall
> > > allowing it to skip the ring file descriptor fdget()/fdput()
> > > operations. This saves some CPU cycles.
> > >
> > > Signed-off-by: Sam Li <faithilikerun@gmail.com>
> > > ---
> > >  block/io_uring.c | 12 +++++++++++-
> > >  meson.build      |  1 +
> > >  2 files changed, 12 insertions(+), 1 deletion(-)
> >
> > Thanks, applied to my block tree:
> > https://gitlab.com/stefanha/qemu/commits/block
> >
>
> Great! Sorry about the mistake before. I'm flushed.

Don't worry, it's easy for #ifdef issues to slip through. Two
techniques for testing #ifdefs:
1. To check whether compilation works both when the macro is defined
and also when it is undefined, edit the #ifdef to force the compiler
to take or not take the #ifdef. For example, if #ifdef FOO is compiled
but you want to test the case where FOO is undefined, temporarily
change it to #ifdef FOOX.
2. Add "#error foo" inside the #ifdef to test whether the compiler is
parsing the code. If you expect the #ifdef to be compiled but there is
no compilation error then there is a problem.

Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]