From 11f27a1c68d27b52838738e8dd58d970d9b6f881 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Wed, 19 Nov 2008 17:29:03 -0500 Subject: [PATCH] clone.2: Document CLONE_IO (new in Linux 2.6.25) Some text also by mtk. Signed-off-by: Michael Kerrisk --- man2/clone.2 | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/man2/clone.2 b/man2/clone.2 index 3fa947e38..0b26ac497 100644 --- a/man2/clone.2 +++ b/man2/clone.2 @@ -35,13 +35,12 @@ .\" 2008-11-18, mtk, document CLONE_NEWPID .\" 2008-11-19, mtk, document CLONE_NEWUTS .\" 2008-11-19, mtk, document CLONE_NEWIPC +.\" 2008-11-19, mtk, document CLONE_IO .\" .\" FIXME Document CLONE_NEWUSER, which is new in 2.6.23 .\" (also supported for unshare()?) .\" FIXME 2.6.25 marks the unused CLONE_STOPPED as obsolete, and it will .\" probably be removed in the future. -.\" FIXME 2.6.25: CLONE_IO flag to clone() causes I/O contexts (used in the -.\" CFQ block I/O scheduler) to be shared with the new child process. .\" .TH CLONE 2 2008-11-19 "Linux" "Linux Programmer's Manual" .SH NAME @@ -224,6 +223,36 @@ Calls to .BR umask (2) performed later by one of the processes do not affect the other process. .TP +.BR CLONE_IO " (since Linux 2.4.25)" +If +.B CLONE_IO +is set, then the new process shares an I/O context with +the calling process. +If this flag is not set, then (as with +.BR fork (2)) +the new process has its own I/O context. + +.\" The following based on text from Jens Axboe +The I/O context is the I/O scope of the disk scheduler (i.e, +what the I/O scheduler uses to model scheduling of a process's I/O). +If processes share the same I/O context, +they are treated as one by the I/O scheduler. +As a consequence, they get to share disk time. +For some I/O schedulers, +.\" the anticipatory and CFQ scheduler +if two processes share an I/O context, +they will be allowed to interleave their disk access. +If several threads are doing I/O on behalf of the same process +.RB ( aio_read (3), +for instance), they should employ +.BR CLONE_IO +to get better I/O performance. +.\" with CFQ and AS. + +If the kernel is not configured with the +.B CONFIG_BLOCK +option, this flag is a no-op. +.TP .BR CLONE_NEWIPC " (since Linux 2.4.19)" If .B CLONE_NEWIPC