From c039a777cc63097d2a074060acd369c895203acd Mon Sep 17 00:00:00 2001 From: Sahitya Tummala Date: Fri, 28 May 2021 19:37:59 +0530 Subject: [PATCH] Revert "aio: only use blk plugs for > 2 depth submissions" This reverts commit a79d40e9b0f309dcddc4e0bf5b64e51e28153e55. This is to fix the performance regression of storage tests observed with fio benchmark. Change-Id: I914bae800d6c7483639551d0ed7f6094b866fa12 Signed-off-by: Sahitya Tummala --- fs/aio.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/fs/aio.c b/fs/aio.c index 47bb7b5685ba..51dd01b578c5 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -71,12 +71,6 @@ struct aio_ring { struct io_event io_events[0]; }; /* 128 bytes + ring size */ -/* - * Plugging is meant to work with larger batches of IOs. If we don't - * have more than the below, then don't bother setting up a plug. - */ -#define AIO_PLUG_THRESHOLD 2 - #define AIO_RING_PAGES 8 struct kioctx_table { @@ -1932,8 +1926,7 @@ SYSCALL_DEFINE3(io_submit, aio_context_t, ctx_id, long, nr, if (nr > ctx->nr_events) nr = ctx->nr_events; - if (nr > AIO_PLUG_THRESHOLD) - blk_start_plug(&plug); + blk_start_plug(&plug); for (i = 0; i < nr; i++) { struct iocb __user *user_iocb; @@ -1946,8 +1939,7 @@ SYSCALL_DEFINE3(io_submit, aio_context_t, ctx_id, long, nr, if (ret) break; } - if (nr > AIO_PLUG_THRESHOLD) - blk_finish_plug(&plug); + blk_finish_plug(&plug); percpu_ref_put(&ctx->users); return i ? i : ret; @@ -1974,8 +1966,7 @@ COMPAT_SYSCALL_DEFINE3(io_submit, compat_aio_context_t, ctx_id, if (nr > ctx->nr_events) nr = ctx->nr_events; - if (nr > AIO_PLUG_THRESHOLD) - blk_start_plug(&plug); + blk_start_plug(&plug); for (i = 0; i < nr; i++) { compat_uptr_t user_iocb; @@ -1988,8 +1979,7 @@ COMPAT_SYSCALL_DEFINE3(io_submit, compat_aio_context_t, ctx_id, if (ret) break; } - if (nr > AIO_PLUG_THRESHOLD) - blk_finish_plug(&plug); + blk_finish_plug(&plug); percpu_ref_put(&ctx->users); return i ? i : ret;