clone.2: Document CLONE_IO (new in Linux 2.6.25)

Some text also by mtk.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Jens Axboe 2008-11-19 17:29:03 -05:00 committed by Michael Kerrisk
parent 63a6efda14
commit 11f27a1c68
1 changed files with 31 additions and 2 deletions

View File

@ -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