From: "Sébastien Dugué" <sebastien.dugue@bull.net>
To: "linux-aio kvack.org" <linux-aio@kvack.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: [PATCH 1/5] Add AIO event ring size tunable
Date: Thu, 28 Jul 2005 17:46:30 +0200 [thread overview]
Message-ID: <1122565590.2019.80.camel@frecb000686> (raw)
[-- Attachment #1: Type: text/plain, Size: 1 bytes --]
[-- Attachment #2: aiomaxevents --]
[-- Type: application/octet-stream, Size: 4235 bytes --]
aiomaxevents :
This patch adds a posix_aio_default_maxevents sysctl variable for configuring the
default AIO context event ring size at runtime. This way, calling sys_io_setup with
nr_events=0, will result in the kernel using the default system value.
This tunable is accessible via /proc/sys/fs/posix-aio-default-max-nr.
Makefile | 2 +-
fs/Kconfig | 8 ++++++++
fs/aio.c | 8 ++++++++
include/linux/aio.h | 3 +++
include/linux/sysctl.h | 3 +++
kernel/sysctl.c | 10 ++++++++++
6 files changed, 33 insertions(+), 1 deletion(-)
Signed-off-by: Sébastien Dugué <sebastien.dugue@bull.net>
Index: linux-2.6.12/fs/aio.c
===================================================================
--- linux-2.6.12.orig/fs/aio.c 2005-06-23 13:58:03.000000000 +0200
+++ linux-2.6.12/fs/aio.c 2005-06-23 13:59:08.000000000 +0200
@@ -43,6 +43,9 @@
/*------ sysctl variables----*/
atomic_t aio_nr = ATOMIC_INIT(0); /* current system wide number of aio requests */
unsigned aio_max_nr = 0x10000; /* system wide maximum number of aio requests */
+#if defined(CONFIG_POSIX_AIO)
+unsigned posix_aio_default_maxevents = 1024; /* FIXME: default value for POSIX AIO */
+#endif /* CONFIG_POSIX_AIO */
/*----end sysctl variables---*/
static kmem_cache_t *kiocb_cachep;
@@ -1244,6 +1247,11 @@
unsigned long ctx;
long ret;
+#if defined(CONFIG_POSIX_AIO)
+ if (nr_events == 0)
+ nr_events = posix_aio_default_maxevents;
+#endif
+
ret = get_user(ctx, ctxp);
if (unlikely(ret))
goto out;
Index: linux-2.6.12/fs/Kconfig
===================================================================
--- linux-2.6.12.orig/fs/Kconfig 2005-06-23 13:58:03.000000000 +0200
+++ linux-2.6.12/fs/Kconfig 2005-06-23 13:59:08.000000000 +0200
@@ -4,6 +4,14 @@
menu "File systems"
+config POSIX_AIO
+ bool "POSIX AIO Support"
+ help
+ Enable POSIX Asynchronous IO
+
+ If unsure, say N.
+
+
config EXT2_FS
tristate "Second extended fs support"
help
Index: linux-2.6.12/include/linux/aio.h
===================================================================
--- linux-2.6.12.orig/include/linux/aio.h 2005-06-23 13:58:03.000000000 +0200
+++ linux-2.6.12/include/linux/aio.h 2005-06-23 13:59:08.000000000 +0200
@@ -153,6 +153,9 @@
/* prototypes */
extern unsigned aio_max_size;
+#if defined(CONFIG_POSIX_AIO)
+extern unsigned posix_aio_default_maxevents;
+#endif /* CONFIG_POSIX_AIO */
extern ssize_t FASTCALL(wait_on_sync_kiocb(struct kiocb *iocb));
extern int FASTCALL(aio_put_req(struct kiocb *iocb));
Index: linux-2.6.12/include/linux/sysctl.h
===================================================================
--- linux-2.6.12.orig/include/linux/sysctl.h 2005-06-23 13:58:03.000000000 +0200
+++ linux-2.6.12/include/linux/sysctl.h 2005-06-23 13:59:08.000000000 +0200
@@ -680,6 +680,9 @@
FS_XFS=17, /* struct: control xfs parameters */
FS_AIO_NR=18, /* current system-wide number of aio requests */
FS_AIO_MAX_NR=19, /* system-wide maximum number of aio requests */
+#if defined(CONFIG_POSIX_AIO)
+ FS_POSIX_AIO_MAX_NR=20, /* default value for POSIX AIO max request */
+#endif /* CONFIG_POSIX_AIO */
};
/* /proc/sys/fs/quota/ */
Index: linux-2.6.12/kernel/sysctl.c
===================================================================
--- linux-2.6.12.orig/kernel/sysctl.c 2005-06-23 13:58:03.000000000 +0200
+++ linux-2.6.12/kernel/sysctl.c 2005-06-23 13:59:08.000000000 +0200
@@ -949,6 +949,16 @@
.mode = 0644,
.proc_handler = &proc_dointvec,
},
+#if defined(CONFIG_POSIX_AIO)
+ {
+ .ctl_name = FS_POSIX_AIO_MAX_NR,
+ .procname = "posix-aio-default-max-nr",
+ .data = &posix_aio_default_maxevents,
+ .maxlen = sizeof(posix_aio_default_maxevents),
+ .mode = 0644,
+ .proc_handler = &proc_dointvec,
+ },
+#endif /* CONFIG_POSIX_AIO */
#endif
{ .ctl_name = 0 }
};
Index: linux-2.6.12/Makefile
===================================================================
--- linux-2.6.12.orig/Makefile 2005-06-23 13:58:03.000000000 +0200
+++ linux-2.6.12/Makefile 2005-06-23 13:59:08.000000000 +0200
@@ -1,7 +1,7 @@
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 12
-EXTRAVERSION =
+EXTRAVERSION = .PAIO-aiomaxevents
NAME=Woozy Numbat
# *DOCUMENTATION*
next reply other threads:[~2005-07-28 15:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-28 15:46 Sébastien Dugué [this message]
2005-07-28 16:52 ` Trond Myklebust
2005-07-29 7:10 ` Sébastien Dugué
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1122565590.2019.80.camel@frecb000686 \
--to=sebastien.dugue@bull.net \
--cc=linux-aio@kvack.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®