"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "stress-aio.c" between
stress-ng-0.13.04.tar.xz and stress-ng-0.13.05.tar.xz

About: stress-ng will stress test a computer system in various selectable ways. It was designed to exercise various physical subsystems of a computer as well as the various operating system kernel interfaces.

stress-aio.c  (stress-ng-0.13.04.tar.xz):stress-aio.c  (stress-ng-0.13.05.tar.xz)
skipping to change at line 111 skipping to change at line 111
if (do_accounting && io_req) if (do_accounting && io_req)
io_req->count++; io_req->count++;
} }
/* /*
* aio_issue_cancel() * aio_issue_cancel()
* cancel an in-progress async I/O request * cancel an in-progress async I/O request
*/ */
static void aio_issue_cancel(const char *name, stress_io_req_t *io_req) static void aio_issue_cancel(const char *name, stress_io_req_t *io_req)
{ {
int ret; int ret, retries = 0;
if (io_req->status != EINPROGRESS) for (;;) {
return; ret = aio_error(&io_req->aiocb);
if (ret != EINPROGRESS)
ret = aio_cancel(io_req->aiocb.aio_fildes, return;
&io_req->aiocb);
switch (ret) { ret = aio_cancel(io_req->aiocb.aio_fildes,
case AIO_CANCELED: &io_req->aiocb);
case AIO_ALLDONE: switch (ret) {
break; case AIO_CANCELED:
case AIO_NOTCANCELED: case AIO_ALLDONE:
pr_dbg("%s: async I/O request %d not cancelled\n", return;
name, io_req->request); case AIO_NOTCANCELED:
break; if (retries++ > 25) {
default: /* Give up */
pr_err("%s: %d error: %d %s\n", pr_inf("%s aio request %d could not be cancelled:
name, io_req->request, error=%d (%s)\n",
errno, strerror(errno)); name, io_req->request,
errno, strerror(errno));
}
/* Wait a bit and retry */
(void)shim_usleep_interruptible(250000);
break;
default:
pr_err("%s: %d error: %d %s\n",
name, io_req->request,
errno, strerror(errno));
break;
}
} }
} }
/* /*
* issue_aio_request() * issue_aio_request()
* construct an AIO request and action it * construct an AIO request and action it
*/ */
static int issue_aio_request( static int issue_aio_request(
const char *name, const char *name,
const int fd, const int fd,
skipping to change at line 343 skipping to change at line 353
rc = EXIT_SUCCESS; rc = EXIT_SUCCESS;
cancel: cancel:
/* Stop accounting */ /* Stop accounting */
do_accounting = false; do_accounting = false;
/* Cancel pending AIO requests */ /* Cancel pending AIO requests */
for (i = 0; i < opt_aio_requests; i++) { for (i = 0; i < opt_aio_requests; i++) {
aio_issue_cancel(args->name, &io_reqs[i]); aio_issue_cancel(args->name, &io_reqs[i]);
total += io_reqs[i].count; total += io_reqs[i].count;
} }
(void)close(fd); (void)close(fd);
finish: finish:
stress_set_proc_state(args->name, STRESS_STATE_DEINIT); stress_set_proc_state(args->name, STRESS_STATE_DEINIT);
free(io_reqs); free(io_reqs);
pr_dbg("%s: total of %" PRIu32 " async I/O signals " pr_dbg("%s: total of %" PRIu32 " async I/O signals "
"caught (instance %d)\n", "caught (instance %d)\n",
args->name, total, args->instance); args->name, total, args->instance);
dt = t2 - t1; dt = t2 - t1;
 End of changes. 3 change blocks. 
18 lines changed or deleted 30 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)