mirror of
https://github.com/ceph/ceph
synced 2025-03-11 02:39:05 +00:00
os/newstore: debug io_submit EAGAIN
Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
parent
dd79b4d832
commit
f9f9e1b105
@ -71,7 +71,7 @@ public:
|
||||
int max_iodepth;
|
||||
io_context_t ctx;
|
||||
|
||||
aio_queue_t(unsigned max_iodepth = 8)
|
||||
aio_queue_t(unsigned max_iodepth)
|
||||
: max_iodepth(max_iodepth),
|
||||
ctx(0) {
|
||||
}
|
||||
@ -91,7 +91,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
int submit(aio_t &aio) {
|
||||
int submit(aio_t &aio, int *retries) {
|
||||
int attempts = 10;
|
||||
iocb *piocb = &aio.iocb;
|
||||
do {
|
||||
@ -99,10 +99,12 @@ public:
|
||||
if (r < 0) {
|
||||
if (r == -EAGAIN && attempts-- > 0) {
|
||||
usleep(500);
|
||||
(*retries)++;
|
||||
continue;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
assert(r == 1);
|
||||
} while (false);
|
||||
return 0;
|
||||
}
|
||||
|
@ -2624,7 +2624,8 @@ int NewStore::queue_transactions(
|
||||
void NewStore::_txc_aio_submit(TransContext *txc)
|
||||
{
|
||||
int num = txc->aios.size();
|
||||
dout(10) << __func__ << " submitting " << num << " aios" << dendl;
|
||||
dout(10) << __func__ << " txc " << txc << " submitting " << num << dendl;
|
||||
assert(num > 0);
|
||||
txc->num_aio.set(num);
|
||||
for (list<FS::aio_t>::iterator p = txc->aios.begin();
|
||||
p != txc->aios.end();
|
||||
@ -2636,7 +2637,10 @@ void NewStore::_txc_aio_submit(TransContext *txc)
|
||||
<< " len " << q->iov_len << dendl;
|
||||
dout(30) << " fd " << aio.fd << " offset " << lseek64(aio.fd, 0, SEEK_CUR)
|
||||
<< dendl;
|
||||
int r = aio_queue.submit(*p);
|
||||
int retries = 0;
|
||||
int r = aio_queue.submit(*p, &retries);
|
||||
if (retries)
|
||||
derr << __func__ << " retries " << retries << dendl;
|
||||
if (r) {
|
||||
derr << " aio submit got " << cpp_strerror(r) << dendl;
|
||||
assert(r == 0);
|
||||
|
Loading…
Reference in New Issue
Block a user