summaryrefslogtreecommitdiff
path: root/fs/aio.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2011-01-26 17:42:27 +0100
committerTejun Heo <tj@kernel.org>2011-01-26 17:42:27 +0100
commitd37adaa1596246929f7ab49843fd124595506175 (patch)
treed7245f60b732d0753b2b2cb4851a54d5829c1838 /fs/aio.c
parent1c1e8646963e319132b4cf551fbfd10b364d0aed (diff)
downloadlwn-d37adaa1596246929f7ab49843fd124595506175.tar.gz
lwn-d37adaa1596246929f7ab49843fd124595506175.zip
fs/aio: aio_wq isn't used in memory reclaim path
aio_wq isn't used during memory reclaim. Convert to alloc_workqueue() without WQ_MEM_RECLAIM. It's possible to use system_wq but given that the number of work items is determined from userland and the work item may block, enforcing strict concurrency limit would be a good idea. Also, move fput_work to system_wq so that aio_wq is used soley to throttle the max concurrency of aio work items and fput_work doesn't interact with other work items. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Jeff Moyer <jmoyer@redhat.com> Cc: Benjamin LaHaise <bcrl@kvack.org> Cc: linux-aio@kvack.org
Diffstat (limited to 'fs/aio.c')
-rw-r--r--fs/aio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/aio.c b/fs/aio.c
index fc557a3be0a9..8007bd675889 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -85,7 +85,7 @@ static int __init aio_setup(void)
kiocb_cachep = KMEM_CACHE(kiocb, SLAB_HWCACHE_ALIGN|SLAB_PANIC);
kioctx_cachep = KMEM_CACHE(kioctx,SLAB_HWCACHE_ALIGN|SLAB_PANIC);
- aio_wq = create_workqueue("aio");
+ aio_wq = alloc_workqueue("aio", 0, 1); /* used to limit concurrency */
abe_pool = mempool_create_kmalloc_pool(1, sizeof(struct aio_batch_entry));
BUG_ON(!aio_wq || !abe_pool);
@@ -569,7 +569,7 @@ static int __aio_put_req(struct kioctx *ctx, struct kiocb *req)
spin_lock(&fput_lock);
list_add(&req->ki_list, &fput_head);
spin_unlock(&fput_lock);
- queue_work(aio_wq, &fput_work);
+ schedule_work(&fput_work);
} else {
req->ki_filp = NULL;
really_put_req(ctx, req);