1. 25 7月, 2022 14 次提交
  2. 08 7月, 2022 1 次提交
  3. 30 6月, 2022 1 次提交
  4. 15 6月, 2022 1 次提交
  5. 31 5月, 2022 1 次提交
    • X
      io_uring: let IORING_OP_FILES_UPDATE support choosing fixed file slots · a7c41b46
      Xiaoguang Wang 提交于
      One big issue with the file registration feature is that it needs user
      space apps to maintain free slot info about io_uring's fixed file table,
      which really is a burden for development. io_uring now supports choosing
      free file slot for user space apps by using IORING_FILE_INDEX_ALLOC flag
      in accept, open, and socket operations, but they need the app to use
      direct accept or direct open, which not all apps are prepared to use yet.
      
      To support apps that still need real fds, make use of the registration
      feature easier. Let IORING_OP_FILES_UPDATE support choosing fixed file
      slots, which will store picked fixed files slots in fd array and let cqe
      return the number of slots allocated.
      Suggested-by: NHao Xu <howeyxu@tencent.com>
      Signed-off-by: NXiaoguang Wang <xiaoguang.wang@linux.alibaba.com>
      [axboe: move flag to uapi io_uring header, change goto to break, init]
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      a7c41b46
  6. 18 5月, 2022 1 次提交
    • J
      io_uring: add support for ring mapped supplied buffers · c7fb1942
      Jens Axboe 提交于
      Provided buffers allow an application to supply io_uring with buffers
      that can then be grabbed for a read/receive request, when the data
      source is ready to deliver data. The existing scheme relies on using
      IORING_OP_PROVIDE_BUFFERS to do that, but it can be difficult to use
      in real world applications. It's pretty efficient if the application
      is able to supply back batches of provided buffers when they have been
      consumed and the application is ready to recycle them, but if
      fragmentation occurs in the buffer space, it can become difficult to
      supply enough buffers at the time. This hurts efficiency.
      
      Add a register op, IORING_REGISTER_PBUF_RING, which allows an application
      to setup a shared queue for each buffer group of provided buffers. The
      application can then supply buffers simply by adding them to this ring,
      and the kernel can consume then just as easily. The ring shares the head
      with the application, the tail remains private in the kernel.
      
      Provided buffers setup with IORING_REGISTER_PBUF_RING cannot use
      IORING_OP_{PROVIDE,REMOVE}_BUFFERS for adding or removing entries to the
      ring, they must use the mapped ring. Mapped provided buffer rings can
      co-exist with normal provided buffers, just not within the same group ID.
      
      To gauge overhead of the existing scheme and evaluate the mapped ring
      approach, a simple NOP benchmark was written. It uses a ring of 128
      entries, and submits/completes 32 at the time. 'Replenish' is how
      many buffers are provided back at the time after they have been
      consumed:
      
      Test			Replenish			NOPs/sec
      ================================================================
      No provided buffers	NA				~30M
      Provided buffers	32				~16M
      Provided buffers	 1				~10M
      Ring buffers		32				~27M
      Ring buffers		 1				~27M
      
      The ring mapped buffers perform almost as well as not using provided
      buffers at all, and they don't care if you provided 1 or more back at
      the same time. This means application can just replenish as they go,
      rather than need to batch and compact, further reducing overhead in the
      application. The NOP benchmark above doesn't need to do any compaction,
      so that overhead isn't even reflected in the above test.
      Co-developed-by: NDylan Yudaken <dylany@fb.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      c7fb1942
  7. 14 5月, 2022 1 次提交
  8. 13 5月, 2022 2 次提交
    • J
      io_uring: add flag for allocating a fully sparse direct descriptor space · a8da73a3
      Jens Axboe 提交于
      Currently to setup a fully sparse descriptor space upfront, the app needs
      to alloate an array of the full size and memset it to -1 and then pass
      that in. Make this a bit easier by allowing a flag that simply does
      this internally rather than needing to copy each slot separately.
      
      This works with IORING_REGISTER_FILES2 as the flag is set in struct
      io_uring_rsrc_register, and is only allow when the type is
      IORING_RSRC_FILE as this doesn't make sense for registered buffers.
      Reviewed-by: NHao Xu <howeyxu@tencent.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      a8da73a3
    • J
      io_uring: allow allocated fixed files for openat/openat2 · 1339f24b
      Jens Axboe 提交于
      If the application passes in IORING_FILE_INDEX_ALLOC as the file_slot,
      then that's a hint to allocate a fixed file descriptor rather than have
      one be passed in directly.
      
      This can be useful for having io_uring manage the direct descriptor space.
      
      Normal open direct requests will complete with 0 for success, and < 0
      in case of error. If io_uring is asked to allocated the direct descriptor,
      then the direct descriptor is returned in case of success.
      Reviewed-by: NHao Xu <howeyxu@tencent.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      1339f24b
  9. 11 5月, 2022 1 次提交
  10. 09 5月, 2022 2 次提交
  11. 06 5月, 2022 1 次提交
  12. 30 4月, 2022 3 次提交
  13. 26 4月, 2022 1 次提交
  14. 25 4月, 2022 6 次提交
  15. 11 4月, 2022 1 次提交
    • J
      io_uring: flag the fact that linked file assignment is sane · c4212f3e
      Jens Axboe 提交于
      Give applications a way to tell if the kernel supports sane linked files,
      as in files being assigned at the right time to be able to reliably
      do <open file direct into slot X><read file from slot X> while using
      IOSQE_IO_LINK to order them.
      
      Not really a bug fix, but flag it as such so that it gets pulled in with
      backports of the deferred file assignment.
      
      Fixes: 6bf9c47a ("io_uring: defer file assignment")
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      c4212f3e
  16. 24 3月, 2022 1 次提交
    • J
      io_uring: remove IORING_CQE_F_MSG · 7ef66d18
      Jens Axboe 提交于
      This was introduced with the message ring opcode, but isn't strictly
      required for the request itself. The sender can encode what is needed
      in user_data, which is passed to the receiver. It's unclear if having
      a separate flag that essentially says "This CQE did not originate from
      an SQE on this ring" provides any real utility to applications. While
      we can always re-introduce a flag to provide this information, we cannot
      take it away at a later point in time.
      
      Remove the flag while we still can, before it's in a released kernel.
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      7ef66d18
  17. 11 3月, 2022 2 次提交
    • J
      io_uring: allow submissions to continue on error · bcbb7bf6
      Jens Axboe 提交于
      By default, io_uring will stop submitting a batch of requests if we run
      into an error submitting a request. This isn't strictly necessary, as
      the error result is passed out-of-band via a CQE anyway. And it can be
      a bit confusing for some applications.
      
      Provide a way to setup a ring that will continue submitting on error,
      when the error CQE has been posted.
      
      There's still one case that will break out of submission. If we fail
      allocating a request, then we'll still return -ENOMEM. We could in theory
      post a CQE for that condition too even if we never got a request. Leave
      that for a potential followup.
      Reported-by: NDylan Yudaken <dylany@fb.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      bcbb7bf6
    • J
      io_uring: add support for IORING_OP_MSG_RING command · 4f57f06c
      Jens Axboe 提交于
      This adds support for IORING_OP_MSG_RING, which allows an SQE to signal
      another ring. That allows either waking up someone waiting on the ring,
      or even passing a 64-bit value via the user_data field in the CQE.
      
      sqe->fd must contain the fd of a ring that should receive the CQE.
      sqe->off will be propagated to the cqe->user_data on the target ring,
      and sqe->len will be propagated to cqe->res. The results CQE will have
      IORING_CQE_F_MSG set in its flags, to indicate that this CQE was generated
      from a messaging request rather than a SQE issued locally on that ring.
      This effectively allows passing a 64-bit and a 32-bit quantify between
      the two rings.
      
      This request type has the following request specific error cases:
      
      - -EBADFD. Set if the sqe->fd doesn't point to a file descriptor that is
        of the io_uring type.
      - -EOVERFLOW. Set if we were not able to deliver a request to the target
        ring.
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      4f57f06c