diff options
author | Tejun Heo <tj@kernel.org> | 2011-01-26 11:42:27 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2011-01-26 11:42:27 -0500 |
commit | d37adaa1596246929f7ab49843fd124595506175 (patch) | |
tree | d7245f60b732d0753b2b2cb4851a54d5829c1838 /fs | |
parent | 1c1e8646963e319132b4cf551fbfd10b364d0aed (diff) |
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')
-rw-r--r-- | fs/aio.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -85,7 +85,7 @@ static int __init aio_setup(void) | |||
85 | kiocb_cachep = KMEM_CACHE(kiocb, SLAB_HWCACHE_ALIGN|SLAB_PANIC); | 85 | kiocb_cachep = KMEM_CACHE(kiocb, SLAB_HWCACHE_ALIGN|SLAB_PANIC); |
86 | kioctx_cachep = KMEM_CACHE(kioctx,SLAB_HWCACHE_ALIGN|SLAB_PANIC); | 86 | kioctx_cachep = KMEM_CACHE(kioctx,SLAB_HWCACHE_ALIGN|SLAB_PANIC); |
87 | 87 | ||
88 | aio_wq = create_workqueue("aio"); | 88 | aio_wq = alloc_workqueue("aio", 0, 1); /* used to limit concurrency */ |
89 | abe_pool = mempool_create_kmalloc_pool(1, sizeof(struct aio_batch_entry)); | 89 | abe_pool = mempool_create_kmalloc_pool(1, sizeof(struct aio_batch_entry)); |
90 | BUG_ON(!aio_wq || !abe_pool); | 90 | BUG_ON(!aio_wq || !abe_pool); |
91 | 91 | ||
@@ -569,7 +569,7 @@ static int __aio_put_req(struct kioctx *ctx, struct kiocb *req) | |||
569 | spin_lock(&fput_lock); | 569 | spin_lock(&fput_lock); |
570 | list_add(&req->ki_list, &fput_head); | 570 | list_add(&req->ki_list, &fput_head); |
571 | spin_unlock(&fput_lock); | 571 | spin_unlock(&fput_lock); |
572 | queue_work(aio_wq, &fput_work); | 572 | schedule_work(&fput_work); |
573 | } else { | 573 | } else { |
574 | req->ki_filp = NULL; | 574 | req->ki_filp = NULL; |
575 | really_put_req(ctx, req); | 575 | really_put_req(ctx, req); |