* [PATCH 1/5] Add AIO event ring size tunable
@ 2005-07-28 15:46 Sébastien Dugué
2005-07-28 16:52 ` Trond Myklebust
0 siblings, 1 reply; 3+ messages in thread
From: Sébastien Dugué @ 2005-07-28 15:46 UTC (permalink / raw)
To: linux-aio kvack.org, linux-kernel
[-- 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*
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/5] Add AIO event ring size tunable
2005-07-28 15:46 [PATCH 1/5] Add AIO event ring size tunable Sébastien Dugué
@ 2005-07-28 16:52 ` Trond Myklebust
2005-07-29 7:10 ` Sébastien Dugué
0 siblings, 1 reply; 3+ messages in thread
From: Trond Myklebust @ 2005-07-28 16:52 UTC (permalink / raw)
To: Sébastien Dugué; +Cc: linux-aio kvack.org, linux-kernel
to den 28.07.2005 Klokka 17:46 (+0200) skreiv Sébastien Dugué:
>
>
>
>
>
>
>
> ukjent vedlegg
> (aiomaxevents)
Please don't post these patches as base-64 encoded anonymous
attachments. It makes them very annoying to review.
In you must use attachments, use inlined ascii. Better still, don't use
attachments at all, but just include the patch in the body of your
email.
Cheers,
Trond
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/5] Add AIO event ring size tunable
2005-07-28 16:52 ` Trond Myklebust
@ 2005-07-29 7:10 ` Sébastien Dugué
0 siblings, 0 replies; 3+ messages in thread
From: Sébastien Dugué @ 2005-07-29 7:10 UTC (permalink / raw)
To: Trond Myklebust; +Cc: linux-aio kvack.org, linux-kernel
On Thu, 2005-07-28 at 12:52 -0400, Trond Myklebust wrote:
> to den 28.07.2005 Klokka 17:46 (+0200) skreiv Sébastien Dugué:
> >
> >
> >
> >
> >
> >
> >
> > ukjent vedlegg
> > (aiomaxevents)
>
> Please don't post these patches as base-64 encoded anonymous
> attachments. It makes them very annoying to review.
>
> In you must use attachments, use inlined ascii. Better still, don't use
> attachments at all, but just include the patch in the body of your
> email.
>
> Cheers,
> Trond
>
Argh, I usually use sylpheed to post patches, but forgot this
time. If someone wants me to resend, just ask.
Sébastien.
--
------------------------------------------------------
Sébastien Dugué BULL/FREC:B1-247
phone: (+33) 476 29 77 70 Bullcom: 229-7770
mailto:sebastien.dugue@bull.net
Linux POSIX AIO: http://www.bullopensource.org/posix
------------------------------------------------------
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-07-29 7:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-28 15:46 [PATCH 1/5] Add AIO event ring size tunable Sébastien Dugué
2005-07-28 16:52 ` Trond Myklebust
2005-07-29 7:10 ` Sébastien Dugué
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®