Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.6.24 /fs/aio.c

Filename:/fs/aio.c
Lines Added:10
Lines Deleted:17
Also changed in: (Previous) 2.6.24-rc8  2.6.24-rc7  2.6.24-rc6  2.6.24-rc5  2.6.24-rc4-git7  2.6.24-rc4-git6 
(Following) 2.6.24-git8  2.6.24-git9  2.6.24-git10  2.6.24-git11  2.6.24-git12  2.6.24-git13 

Location
[  2.6.24
  [  fs
     o  aio.c

Patch

diff --git a/fs/aio.c b/fs/aio.c
index ea2e198..9dec7d2 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -303,7 +303,7 @@ static void wait_for_all_aios(struct kioctx *ctx)
    set_task_state(tsk, TASK_UNINTERRUPTIBLE);
    while (ctx->reqs_active) {
       spin_unlock_irq(&ctx->ctx_lock);
-      schedule();
+      io_schedule();
       set_task_state(tsk, TASK_UNINTERRUPTIBLE);
       spin_lock_irq(&ctx->ctx_lock);
    }
@@ -323,7 +323,7 @@ ssize_t fastcall wait_on_sync_kiocb(struct kiocb *iocb)
       set_current_state(TASK_UNINTERRUPTIBLE);
       if (!iocb->ki_users)
          break;
-      schedule();
+      io_schedule();
    }
    __set_current_state(TASK_RUNNING);
    return iocb->ki_user_data;
@@ -710,18 +710,9 @@ static ssize_t aio_run_iocb(struct kiocb *iocb)
 
    /*
     * Now we are all set to call the retry method in async
-    * context. By setting this thread's io_wait context
-    * to point to the wait queue entry inside the currently
-    * running iocb for the duration of the retry, we ensure
-    * that async notification wakeups are queued by the
-    * operation instead of blocking waits, and when notified,
-    * cause the iocb to be kicked for continuation (through
-    * the aio_wake_function callback).
+    * context.
     */
-   BUG_ON(current->io_wait != NULL);
-   current->io_wait = &iocb->ki_wait;
    ret = retry(iocb);
-   current->io_wait = NULL;
 
    if (ret != -EIOCBRETRY && ret != -EIOCBQUEUED) {
       BUG_ON(!list_empty(&iocb->ki_wait.task_list));
@@ -1170,7 +1161,12 @@ retry:
          ret = 0;
          if (to.timed_out)   /* Only check after read evt */
             break;
-         schedule();
+         /* Try to only show up in io wait if there are ops
+          *  in flight */
+         if (ctx->reqs_active)
+            io_schedule();
+         else
+            schedule();
          if (signal_pending(tsk)) {
             ret = -EINTR;
             break;
@@ -1508,10 +1504,7 @@ static ssize_t aio_setup_iocb(struct kiocb *kiocb)
  *    Simply triggers a retry of the operation via kick_iocb.
  *
  *    This callback is specified in the wait queue entry in
- *   a kiocb   (current->io_wait points to this wait queue
- *   entry when an aio operation executes; it is used
- *    instead of a synchronous wait when an i/o blocking
- *   condition is encountered during aio).
+ *   a kiocb.
  *
  * Note:
  * This routine is executed with the wait queue lock held.


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.