summaryrefslogtreecommitdiffstats
path: root/fs/aio.c
diff options
context:
space:
mode:
authorBenjamin LaHaise <bcrl@kvack.org>2013-07-30 12:06:37 -0400
committerBenjamin LaHaise <bcrl@kvack.org>2013-07-30 12:06:37 -0400
commit4cd81c3dfc4a34e4a0b6fa577860077c8e5b13af (patch)
treeaba6e085ad0193bde59f599b0ad7b3ddb484b744 /fs/aio.c
parentd29c445b635b3a03cf683cafcbae58a4ec1e1125 (diff)
downloadlinux-4cd81c3dfc4a34e4a0b6fa577860077c8e5b13af.tar.bz2
aio: double aio_max_nr in calculations
With the changes to use percpu counters for aio event ring size calculation, existing increases to aio_max_nr are now insufficient to allow for the allocation of enough events. Double the value used for aio_max_nr to account for the doubling introduced by the percpu slack. Signed-off-by: Benjamin LaHaise <bcrl@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 e46b1195191b..945dd0d072f3 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -490,7 +490,7 @@ static struct kioctx *ioctx_alloc(unsigned nr_events)
return ERR_PTR(-EINVAL);
}
- if (!nr_events || (unsigned long)nr_events > aio_max_nr)
+ if (!nr_events || (unsigned long)nr_events > (aio_max_nr * 2UL))
return ERR_PTR(-EAGAIN);
ctx = kmem_cache_zalloc(kioctx_cachep, GFP_KERNEL);
@@ -522,7 +522,7 @@ static struct kioctx *ioctx_alloc(unsigned nr_events)
/* limit the number of system wide aios */
spin_lock(&aio_nr_lock);
- if (aio_nr + nr_events > aio_max_nr ||
+ if (aio_nr + nr_events > (aio_max_nr * 2UL) ||
aio_nr + nr_events < aio_nr) {
spin_unlock(&aio_nr_lock);
goto out_cleanup;