VirtualBox

Changeset 79949 in vbox


Ignore:
Timestamp:
Jul 24, 2019 11:05:45 AM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
132374
Message:

Runtime: bugref:8231 Starting on defining and implementing a new RTIoQueue API to replace RTFileAio mid term.

The RTIoQueue API is meant to be more efficient as it doesn't require allocation
of request structures and is only meant as a thin layer around host dependent APIs.
It will support mutiple providers for different handle types and the best suited provider
supported on a particular host can be selected. This allows multiple implementations
to coexist for the same host in an easy manner.
The providers currently being implemented are (in various stages of the implementation):

  • ioqueue-stdfile-provider.cpp:

A fallback provider if nothing else is available using the synchronous RTFile* APIs
emulating asynchronous behavior by using a dedicated worker thread.

  • ioqueue-aiofile-provider.cpp:

Uses the current RTFileAio* API, will get replaced by dedicated provider implementations for
each host later on.

  • ioqueue-iouringfile-provider.cpp:

Uses the recently added io_uring interface for Linux kernels 5.1 and newer. The new interface
is a great improvement over the old aio interface which is cumbersome to use and has various
restrictions. If not available on a host the code can fall back to one of the other providers.

The I/O queue interface is also meant to be suitable for sockets which can be implemented later.

Location:
trunk
Files:
7 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/err.h

    r77941 r79949  
    26872687/** @} */
    26882688
     2689
     2690/** @name RTIoQueue status codes
     2691 * @{ */
     2692/** The handle was not registered for use with the I/O queue. */
     2693#define VERR_IOQUEUE_HANDLE_NOT_REGISTERED                      (-26200)
     2694/** The I/O queue is full and can't accept more requests. */
     2695#define VERR_IOQUEUE_FULL                                       (-26201)
     2696/** The I/O queue doesn't contain any prepared requests to commit or wait for completion. */
     2697#define VERR_IOQUEUE_EMPTY                                      (-26202)
     2698/** The I/O queue has requests pending which need complete first. */
     2699#define VERR_IOQUEUE_BUSY                                       (-26203)
     2700/** @} */
     2701
    26892702/* SED-END */
    26902703
  • trunk/include/iprt/log.h

    r77558 r79949  
    6363    RTLOGGROUP_FS,
    6464    RTLOGGROUP_HTTP,
     65    RTLOGGROUP_IOQUEUE,
    6566    RTLOGGROUP_LDR,
    6667    RTLOGGROUP_LOCALIPC,
     
    99100    "RT_FS", \
    100101    "RT_HTTP", \
     102    "RT_IOQUEUE", \
    101103    "RT_LDR", \
    102104    "RT_LOCALIPC", \
     
    109111    "RT_TIMER", \
    110112    "RT_VFS", \
    111     "RT_18", \
    112113    "RT_19", \
    113114    "RT_20", \
  • trunk/include/iprt/mangling.h

    r79570 r79949  
    11431143# define RTIniFileQueryPair                             RT_MANGLER(RTIniFileQueryPair)
    11441144# define RTIniFileQueryValue                            RT_MANGLER(RTIniFileQueryValue)
     1145# define RTIoQueueCommit                                RT_MANGLER(RTIoQueueCommit)
     1146# define RTIoQueueCreate                                RT_MANGLER(RTIoQueueCreate)
     1147# define RTIoQueueDestroy                               RT_MANGLER(RTIoQueueDestroy)
     1148# define RTIoQueueEvtWait                               RT_MANGLER(RTIoQueueEvtWait)
     1149# define RTIoQueueEvtWaitWakeup                         RT_MANGLER(RTIoQueueEvtWaitWakeup)
     1150# define RTIoQueueHandleDeregister                      RT_MANGLER(RTIoQueueHandleDeregister)
     1151# define RTIoQueueHandleRegister                        RT_MANGLER(RTIoQueueHandleRegister)
     1152# define RTIoQueueProviderGetBestForHndType             RT_MANGLER(RTIoQueueProviderGetBestForHndType)
     1153# define RTIoQueueProviderGetById                       RT_MANGLER(RTIoQueueProviderGetById)
     1154# define RTIoQueueRequestPrepare                        RT_MANGLER(RTIoQueueRequestPrepare)
     1155# define RTIoQueueRequestPrepareSg                      RT_MANGLER(RTIoQueueRequestPrepareSg)
    11451156# define RTJsonIteratorBegin                            RT_MANGLER(RTJsonIteratorBegin)
    11461157# define RTJsonIteratorBeginArray                       RT_MANGLER(RTJsonIteratorBeginArray)
     
    39473958# define g_cRTCrKeyAllMarkers                           RT_MANGLER(g_cRTCrKeyAllMarkers)
    39483959# define g_acRTThreadTypeStats                          RT_MANGLER(g_acRTThreadTypeStats) /* internal */
     3960# define g_RTIoQueueStdFileProv                         RT_MANGLER(g_RTIoQueueStdFileProv) /* internal */
     3961# define g_RTIoQueueAioFileProv                         RT_MANGLER(g_RTIoQueueAioFileProv) /* internal */
     3962# define g_RTIoQueueLnxIoURingProv                      RT_MANGLER(g_RTIoQueueLnxIoURingProv) /* internal */
    39493963
    39503964#if 0 /* Disabled for now as I'm not sure the assmbler supports mangling yet. */
  • trunk/src/VBox/Runtime/Makefile.kmk

    r79891 r79949  
    447447        common/fs/ntfsvfs.cpp \
    448448        common/fs/RTFsCmdLs.cpp \
     449        common/ioqueue/ioqueuebase.cpp \
     450        common/ioqueue/ioqueue-aiofile-provider.cpp \
     451        common/ioqueue/ioqueue-stdfile-provider.cpp \
    449452        common/ldr/ldr.cpp \
    450453        common/ldr/ldrELF.cpp \
     
    21712174        $(VBoxRT_0_OUTDIR)/VBoxRT.def
    21722175VBoxRT_SOURCES.linux          += \
    2173         r3/linux/fileaio-linux.cpp
     2176        r3/linux/fileaio-linux.cpp \
     2177        r3/linux/ioqueue-iouringfile-provider.cpp
    21742178VBoxRT_SOURCES.solaris        += \
    21752179        r3/solaris/fileaio-solaris.cpp
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette