An error occurred fetching the project authors.
  1. 22 Jun, 2020 14 commits
  2. 18 Jun, 2020 1 commit
    • Xiaoguang Wang's avatar
      io_uring: fix possible race condition against REQ_F_NEED_CLEANUP · 6f2cc166
      Xiaoguang Wang authored
      In io_read() or io_write(), when io request is submitted successfully,
      it'll go through the below sequence:
      
          kfree(iovec);
          req->flags &= ~REQ_F_NEED_CLEANUP;
          return ret;
      
      But clearing REQ_F_NEED_CLEANUP might be unsafe. The io request may
      already have been completed, and then io_complete_rw_iopoll()
      and io_complete_rw() will be called, both of which will also modify
      req->flags if needed. This causes a race condition, with concurrent
      non-atomic modification of req->flags.
      
      To eliminate this race, in io_read() or io_write(), if io request is
      submitted successfully, we don't remove REQ_F_NEED_CLEANUP flag. If
      REQ_F_NEED_CLEANUP is set, we'll leave __io_req_aux_free() to the
      iovec cleanup work correspondingly.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarXiaoguang Wang <xiaoguang.wang@linux.alibaba.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      6f2cc166
  3. 17 Jun, 2020 4 commits
  4. 15 Jun, 2020 6 commits
  5. 11 Jun, 2020 5 commits
  6. 10 Jun, 2020 3 commits
    • Xiaoguang Wang's avatar
      io_uring: avoid unnecessary io_wq_work copy for fast poll feature · 405a5d2b
      Xiaoguang Wang authored
      Basically IORING_OP_POLL_ADD command and async armed poll handlers
      for regular commands don't touch io_wq_work, so only REQ_F_WORK_INITIALIZED
      is set, can we do io_wq_work copy and restore.
      Signed-off-by: default avatarXiaoguang Wang <xiaoguang.wang@linux.alibaba.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      405a5d2b
    • Xiaoguang Wang's avatar
      io_uring: avoid whole io_wq_work copy for requests completed inline · 7cdaf587
      Xiaoguang Wang authored
      If requests can be submitted and completed inline, we don't need to
      initialize whole io_wq_work in io_init_req(), which is an expensive
      operation, add a new 'REQ_F_WORK_INITIALIZED' to determine whether
      io_wq_work is initialized and add a helper io_req_init_async(), users
      must call io_req_init_async() for the first time touching any members
      of io_wq_work.
      
      I use /dev/nullb0 to evaluate performance improvement in my physical
      machine:
        modprobe null_blk nr_devices=1 completion_nsec=0
        sudo taskset -c 60 fio  -name=fiotest -filename=/dev/nullb0 -iodepth=128
        -thread -rw=read -ioengine=io_uring -direct=1 -bs=4k -size=100G -numjobs=1
        -time_based -runtime=120
      
      before this patch:
      Run status group 0 (all jobs):
         READ: bw=724MiB/s (759MB/s), 724MiB/s-724MiB/s (759MB/s-759MB/s),
         io=84.8GiB (91.1GB), run=120001-120001msec
      
      With this patch:
      Run status group 0 (all jobs):
         READ: bw=761MiB/s (798MB/s), 761MiB/s-761MiB/s (798MB/s-798MB/s),
         io=89.2GiB (95.8GB), run=120001-120001msec
      
      About 5% improvement.
      Signed-off-by: default avatarXiaoguang Wang <xiaoguang.wang@linux.alibaba.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      7cdaf587
    • Jens Axboe's avatar
      io_uring: allow O_NONBLOCK async retry · c5b85625
      Jens Axboe authored
      We can assume that O_NONBLOCK is always honored, even if we don't
      have a ->read/write_iter() for the file type. Also unify the read/write
      checking for allowing async punt, having the write side factoring in the
      REQ_F_NOWAIT flag as well.
      
      Cc: stable@vger.kernel.org
      Fixes: 490e8967 ("io_uring: only force async punt if poll based retry can't handle it")
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      c5b85625
  7. 09 Jun, 2020 1 commit
  8. 08 Jun, 2020 6 commits