diff options
-rw-r--r-- | fs/aio.c | 33 |
1 files changed, 5 insertions, 28 deletions
@@ -40,9 +40,6 @@ | |||
40 | #define dprintk(x...) do { ; } while (0) | 40 | #define dprintk(x...) do { ; } while (0) |
41 | #endif | 41 | #endif |
42 | 42 | ||
43 | static long aio_run = 0; /* for testing only */ | ||
44 | static long aio_wakeups = 0; /* for testing only */ | ||
45 | |||
46 | /*------ sysctl variables----*/ | 43 | /*------ sysctl variables----*/ |
47 | atomic_t aio_nr = ATOMIC_INIT(0); /* current system wide number of aio requests */ | 44 | atomic_t aio_nr = ATOMIC_INIT(0); /* current system wide number of aio requests */ |
48 | unsigned aio_max_nr = 0x10000; /* system wide maximum number of aio requests */ | 45 | unsigned aio_max_nr = 0x10000; /* system wide maximum number of aio requests */ |
@@ -617,7 +614,6 @@ static inline int __queue_kicked_iocb(struct kiocb *iocb) | |||
617 | if (list_empty(&iocb->ki_run_list)) { | 614 | if (list_empty(&iocb->ki_run_list)) { |
618 | list_add_tail(&iocb->ki_run_list, | 615 | list_add_tail(&iocb->ki_run_list, |
619 | &ctx->run_list); | 616 | &ctx->run_list); |
620 | iocb->ki_queued++; | ||
621 | return 1; | 617 | return 1; |
622 | } | 618 | } |
623 | return 0; | 619 | return 0; |
@@ -658,10 +654,8 @@ static ssize_t aio_run_iocb(struct kiocb *iocb) | |||
658 | } | 654 | } |
659 | 655 | ||
660 | if (!(iocb->ki_retried & 0xff)) { | 656 | if (!(iocb->ki_retried & 0xff)) { |
661 | pr_debug("%ld retry: %d of %d (kick %ld, Q %ld run %ld, wake %ld)\n", | 657 | pr_debug("%ld retry: %d of %d\n", iocb->ki_retried, |
662 | iocb->ki_retried, | 658 | iocb->ki_nbytes - iocb->ki_left, iocb->ki_nbytes); |
663 | iocb->ki_nbytes - iocb->ki_left, iocb->ki_nbytes, | ||
664 | iocb->ki_kicked, iocb->ki_queued, aio_run, aio_wakeups); | ||
665 | } | 659 | } |
666 | 660 | ||
667 | if (!(retry = iocb->ki_retry)) { | 661 | if (!(retry = iocb->ki_retry)) { |
@@ -768,7 +762,6 @@ out: | |||
768 | static int __aio_run_iocbs(struct kioctx *ctx) | 762 | static int __aio_run_iocbs(struct kioctx *ctx) |
769 | { | 763 | { |
770 | struct kiocb *iocb; | 764 | struct kiocb *iocb; |
771 | int count = 0; | ||
772 | LIST_HEAD(run_list); | 765 | LIST_HEAD(run_list); |
773 | 766 | ||
774 | list_splice_init(&ctx->run_list, &run_list); | 767 | list_splice_init(&ctx->run_list, &run_list); |
@@ -783,9 +776,7 @@ static int __aio_run_iocbs(struct kioctx *ctx) | |||
783 | aio_run_iocb(iocb); | 776 | aio_run_iocb(iocb); |
784 | if (__aio_put_req(ctx, iocb)) /* drop extra ref */ | 777 | if (__aio_put_req(ctx, iocb)) /* drop extra ref */ |
785 | put_ioctx(ctx); | 778 | put_ioctx(ctx); |
786 | count++; | ||
787 | } | 779 | } |
788 | aio_run++; | ||
789 | if (!list_empty(&ctx->run_list)) | 780 | if (!list_empty(&ctx->run_list)) |
790 | return 1; | 781 | return 1; |
791 | return 0; | 782 | return 0; |
@@ -884,10 +875,8 @@ static void queue_kicked_iocb(struct kiocb *iocb) | |||
884 | spin_lock_irqsave(&ctx->ctx_lock, flags); | 875 | spin_lock_irqsave(&ctx->ctx_lock, flags); |
885 | run = __queue_kicked_iocb(iocb); | 876 | run = __queue_kicked_iocb(iocb); |
886 | spin_unlock_irqrestore(&ctx->ctx_lock, flags); | 877 | spin_unlock_irqrestore(&ctx->ctx_lock, flags); |
887 | if (run) { | 878 | if (run) |
888 | aio_queue_work(ctx); | 879 | aio_queue_work(ctx); |
889 | aio_wakeups++; | ||
890 | } | ||
891 | } | 880 | } |
892 | 881 | ||
893 | /* | 882 | /* |
@@ -907,7 +896,6 @@ void fastcall kick_iocb(struct kiocb *iocb) | |||
907 | return; | 896 | return; |
908 | } | 897 | } |
909 | 898 | ||
910 | iocb->ki_kicked++; | ||
911 | /* If its already kicked we shouldn't queue it again */ | 899 | /* If its already kicked we shouldn't queue it again */ |
912 | if (!kiocbTryKick(iocb)) { | 900 | if (!kiocbTryKick(iocb)) { |
913 | queue_kicked_iocb(iocb); | 901 | queue_kicked_iocb(iocb); |
@@ -1003,10 +991,8 @@ int fastcall aio_complete(struct kiocb *iocb, long res, long res2) | |||
1003 | 991 | ||
1004 | pr_debug("added to ring %p at [%lu]\n", iocb, tail); | 992 | pr_debug("added to ring %p at [%lu]\n", iocb, tail); |
1005 | 993 | ||
1006 | pr_debug("%ld retries: %d of %d (kicked %ld, Q %ld run %ld wake %ld)\n", | 994 | pr_debug("%ld retries: %d of %d\n", iocb->ki_retried, |
1007 | iocb->ki_retried, | 995 | iocb->ki_nbytes - iocb->ki_left, iocb->ki_nbytes); |
1008 | iocb->ki_nbytes - iocb->ki_left, iocb->ki_nbytes, | ||
1009 | iocb->ki_kicked, iocb->ki_queued, aio_run, aio_wakeups); | ||
1010 | put_rq: | 996 | put_rq: |
1011 | /* everything turned out well, dispose of the aiocb. */ | 997 | /* everything turned out well, dispose of the aiocb. */ |
1012 | ret = __aio_put_req(ctx, iocb); | 998 | ret = __aio_put_req(ctx, iocb); |
@@ -1114,7 +1100,6 @@ static int read_events(struct kioctx *ctx, | |||
1114 | int i = 0; | 1100 | int i = 0; |
1115 | struct io_event ent; | 1101 | struct io_event ent; |
1116 | struct aio_timeout to; | 1102 | struct aio_timeout to; |
1117 | int event_loop = 0; /* testing only */ | ||
1118 | int retry = 0; | 1103 | int retry = 0; |
1119 | 1104 | ||
1120 | /* needed to zero any padding within an entry (there shouldn't be | 1105 | /* needed to zero any padding within an entry (there shouldn't be |
@@ -1181,7 +1166,6 @@ retry: | |||
1181 | if (to.timed_out) /* Only check after read evt */ | 1166 | if (to.timed_out) /* Only check after read evt */ |
1182 | break; | 1167 | break; |
1183 | schedule(); | 1168 | schedule(); |
1184 | event_loop++; | ||
1185 | if (signal_pending(tsk)) { | 1169 | if (signal_pending(tsk)) { |
1186 | ret = -EINTR; | 1170 | ret = -EINTR; |
1187 | break; | 1171 | break; |
@@ -1209,9 +1193,6 @@ retry: | |||
1209 | if (timeout) | 1193 | if (timeout) |
1210 | clear_timeout(&to); | 1194 | clear_timeout(&to); |
1211 | out: | 1195 | out: |
1212 | pr_debug("event loop executed %d times\n", event_loop); | ||
1213 | pr_debug("aio_run %ld\n", aio_run); | ||
1214 | pr_debug("aio_wakeups %ld\n", aio_wakeups); | ||
1215 | return i ? i : ret; | 1196 | return i ? i : ret; |
1216 | } | 1197 | } |
1217 | 1198 | ||
@@ -1526,10 +1507,6 @@ int fastcall io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb, | |||
1526 | init_waitqueue_func_entry(&req->ki_wait, aio_wake_function); | 1507 | init_waitqueue_func_entry(&req->ki_wait, aio_wake_function); |
1527 | INIT_LIST_HEAD(&req->ki_wait.task_list); | 1508 | INIT_LIST_HEAD(&req->ki_wait.task_list); |
1528 | req->ki_retried = 0; | 1509 | req->ki_retried = 0; |
1529 | req->ki_kicked = 0; | ||
1530 | req->ki_queued = 0; | ||
1531 | aio_run = 0; | ||
1532 | aio_wakeups = 0; | ||
1533 | 1510 | ||
1534 | ret = aio_setup_iocb(req); | 1511 | ret = aio_setup_iocb(req); |
1535 | 1512 | ||