Skip to content

Conversation

@JacksonYao287
Copy link
Contributor

@JacksonYao287 JacksonYao287 commented Apr 15, 2024

from the debug info below , we know the io_uring error is caused by the unalignment of offset

$3 = (iomgr::drive_iocb) {
  _vptr.drive_iocb = 0x55555a4a5908 <vtable for iomgr::drive_iocb+16>,
  static inlined_iov_count = 4,
  iodev = 0x55555ae71e00,
  iface = 0x55555acd7720,
  op_type = iomgr::DriveOpType::WRITE,
  size = 1024,
  offset = 10647755115,
  unique_id = 0,
  iovcnt = 1,
  result = -22,
  completion = std::variant<> [no contained value],
  resubmit_cnt = 0,
  part_read_resubmit_cnt = 0,
  initiating_reactor = 0x0,
  iocb_id = 2,
  op_start_time = {
    __d = {
      __r = 22743123547526470
    }
  },
  op_submit_time = {
    __d = {
      __r = 0
    }
  },
  user_data = std::variant<std::array<iovec, 4>, std::unique_ptr<iovec[]>, char *> [index 0] = {{
      _M_elems = {{
          iov_base = 0x55555c3e2400,
          iov_len = 1024
        }, {
          iov_base = 0x0,
          iov_len = 0
        }, {
          iov_base = 0x0,
          iov_len = 0
        }, {
          iov_base = 0x0,
          iov_len = 0
        }}
    }}
}

"{} Virtual device is attempted to be created with size={}, it needs to be rounded to new_size={}",
vparam.vdev_name, in_bytes(input_vdev_size), in_bytes(vparam.vdev_size));
}

Copy link
Contributor Author

@JacksonYao287 JacksonYao287 Apr 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should first compute the final vparam.num_chunks, then compute vparam.vdev_size according to the final vparam.num_chunks, so that we can get a aligned chunk size.

otherwise , we will first get a vdev_size from the num_chunks of direct input vparam.num_chunks, which might may be different from the final vparam.num_chunks and lead to unalignment

for the testcase failure eBay/HomeObject#167
if the input num_chunks is less than the max_number_chunks(with out this PR is 960), then everything goes well. otherwise, since the final vparam.num_chunks is max_number_chunks, but the chunk size is computed according to the input vparam.num_chunks(65000), this will lead to a unaligned chunk size , which will lead to io_uring failuer

@JacksonYao287
Copy link
Contributor Author

closed , and changes in this PR will be made in #381

@JacksonYao287 JacksonYao287 deleted the fix-io_uring-issue branch August 21, 2024 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant