lkml.org 
[lkml]   [2008]   [Jun]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] aio: avoid using queue_delayed_work in aio_kick_handler to schedule itself
Date

Avoid using queue_delayed_work in aio_kick_handler() to run itself
immediately. Instead use aio_run_all_iocbs()

Signed-off-by: Nikanth Karthikesan <knikanth@suse.de>

---

diff --git a/fs/aio.c b/fs/aio.c
index e27f611..7817e8f 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -823,21 +823,13 @@ static void aio_kick_handler(struct work_struct *work)
struct kioctx *ctx = container_of(work, struct kioctx, wq.work);
mm_segment_t oldfs = get_fs();
struct mm_struct *mm;
- int requeue;

set_fs(USER_DS);
- use_mm(ctx->mm);
- spin_lock_irq(&ctx->ctx_lock);
- requeue =__aio_run_iocbs(ctx);
mm = ctx->mm;
- spin_unlock_irq(&ctx->ctx_lock);
+ use_mm(mm);
+ aio_run_all_iocbs(ctx);
unuse_mm(mm);
set_fs(oldfs);
- /*
- * we're in a worker thread already, don't use queue_delayed_work,
- */
- if (requeue)
- queue_delayed_work(aio_wq, &ctx->wq, 0);
}



\
 
 \ /
  Last update: 2008-06-26 13:09    [W:0.115 / U:3.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site