Commit Graph

3312 Commits

Author SHA1 Message Date
Michael Kerrisk d1d4f69503 cgroups.7: srcfix: remove FIXME
Tejun noted that his statement wasn't correct.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-01-10 00:35:47 +01:00
Michael Kerrisk ed3f4f34fc cgroups.7: Document cgroup v2 delegation via the 'nsdelegate' mount option
Reviewed-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-01-10 00:35:47 +01:00
Michael Kerrisk 148e0800eb cgroups.7: Modify cgroup v2 delegation subheading
We are about to add description of a different kind
of delegation (nsdelegate) with its own subheading.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-01-10 00:35:47 +01:00
Michael Kerrisk 27b086e998 cgroups.7: Add a subheading for delegation containment rules
This is useful in preparation for adding discussion of the
'nsdelegate' mount option.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-01-10 00:35:47 +01:00
Michael Kerrisk 6413d78493 cgroups.7: Document /sys/kernel/cgroup/features
Reviewed-by: Roman Gushchin <guro@fb.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-01-10 00:35:47 +01:00
Michael Kerrisk 668ef76586 cgroups.7: Document /sys/kernel/cgroup/delegate
Reviewed-by: Roman Gushchin <guro@fb.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-01-10 00:35:47 +01:00
Michael Kerrisk 28f612ea3d cgroups.7: Note Linux 4.11 changes to cgroup v2 delegation containment rules
See kernel commit 576dd464505fc53d501bb94569db76f220104d28

Reported-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-01-10 00:35:47 +01:00
Michael Kerrisk 896305ece8 cgroups.7: srcfix: Remove FIXME
Tejun Heo confirmed that the existing text is correct.

Reported-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-01-10 00:35:46 +01:00
Michael Kerrisk e5936eb62f cgroups.7: Tweak the description of delegation of cgroup.subtree_control
Reported-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-01-10 00:35:46 +01:00
Michael Kerrisk 00c2709250 cgroups.7: Remove bogus "constraint" relating to thread mode
Existing cgroups under threaded root *must*, by definition,
be either domain or part of threaded subtrees, so this is not
a constraint on the creation of threaded subtrees.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-01-10 00:35:46 +01:00
Michael Kerrisk c7f63e7434 cgroups.7: Minor tweaks to text on cgroup.stat
Reported-by: Roman Gushchin <guro@fb.com>
Reviewed-by: Roman Gushchin <guro@fb.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-01-10 00:35:43 +01:00
Michael Kerrisk 06dadef809 cgroups.7: srcfix: FIXME (nsdelegate)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-01-10 00:32:19 +01:00
Michael Kerrisk 75e83bc270 cgroups.7: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-01-10 00:32:19 +01:00
Michael Kerrisk d0dd7b8844 cgroups.7: srcfix FIXME
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-01-10 00:32:18 +01:00
Michael Kerrisk 1de5994653 cgroups.7: srcfix: FIXME
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-01-10 00:32:18 +01:00
Michael Kerrisk b59229e4f9 cgroups.7: srcfix FIXME
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-01-10 00:32:18 +01:00
Michael Kerrisk 0735069bf3 cgroups.7: Minor tweak to text on v2 delegation
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-01-10 00:32:18 +01:00
Michael Kerrisk e5bd7e6598 cgroups.7: Minor fix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-01-10 00:32:18 +01:00
Michael Kerrisk 5714ccee0a cgroups.7: Add some section (SH) headings
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-01-10 00:32:18 +01:00
Michael Kerrisk c8902e25cc cgroups.7: Document cgroups v2 "thread mode"
Reviewed-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-01-10 00:32:18 +01:00
Michael Kerrisk e91d4f9ee7 cgroups.7: Mention the existence of "thread mode" in Linux 4.14
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-01-10 00:32:18 +01:00
Michael Kerrisk 5845e10bdb cgroups.7: Document the cgroup.max.depth and cgroup.max.descendants files
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-01-10 00:32:18 +01:00
Michael Kerrisk 5e071499bb cgroups.7: Document cgroups v2 cgroup.stat file
Based on the text in Documentation/cgroup-v2.txt.

Reviewed-by: Roman Gushchin <guro@fb.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-01-10 00:32:18 +01:00
Michael Kerrisk f7286edcde cgroups.7: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-01-10 00:32:18 +01:00
Michael Kerrisk eaf4a2607b sched.7: Correctly describe effect of priority changes for RT threads
The placement of a thread in the run queue for its new
priority depends on the direction of movement in priority.
(This appears to contradict POSIX, except in the case of
pthread_setschedprio().)

As reported by Andrea, and followed up by me:

> I point out that the semantics of sched_setscheduler(2) for RT threads
> indicated in sched(7) and, in particular, in
>
>    "A call to sched_setscheduler(2), sched_setparam(2), or
>     sched_setattr(2) will put the SCHED_FIFO (or SCHED_RR) thread
>     identified by pid at the start of the list if it was runnable."
>
> does not "reflect" the current implementation of this syscall(s) that, in
> turn; based on the source, I think a more appropriate description of this
> semantics would be:
>
>    "... the effect on its position in the thread list depends on the
>     direction  of the modification, as follows:
>
>       a. if the priority is raised, the thread becomes the tail of the
>          thread list.
>       b. if the priority is unchanged, the thread does not change position
>          in the thread list.
>       c. if the priority is lowered, the thread becomes the head of the
>          thread list."
>
> (copied from
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_08_04_01
> ).

So, I did some testing, and can confirm that the above is the behavior
on Linux for changes to scheduling priorities for RT processes.
(My tests consisted of creating a multithreaded process where all
threads are confined to the same CPU with taskset(), and each thread
is in a CPU-bound loop. I then maipulated their priorities with
chrt(1) and watched the CPU time being consumed with ps(1).)

Back in SUSv2 there was this text:

[[
6. If a thread whose policy or priority has been modified is a running
thread or is runnable, it then becomes the tail of the thread list for
its new priority.
]]

And certainly Linux used to behave this way. I remember testing it,
and when one looks at the Linux 2.2 source code for example, one can
see that there is a call to move_first_runqueue() in this case. At some
point, things changed, and I have not investigated exactly where that
change occurred (but I imagine it was quite a long time ago).

Looking at SUSv4, let's expand the range of your quote, since
point 7 is interesting. Here's text from Section 2.8.4
"Process Scheduling" in POSIX.1-2008/SUSv4 TC2:

[[
7. If a thread whose policy or priority has been modified other
   than by pthread_setschedprio() is a running thread or is runnable,
   it then becomes the tail of the thread list for its new priority.
8. If a thread whose priority has been modified by pthread_setschedprio()
   is a running thread or is runnable, the effect on its position in the
   thread list depends on the direction of the modification, as follows:
   a. If the priority is raised, the thread becomes the tail of the
      thread list.
   b. If the priority is unchanged, the thread does not change position
      in the thread list.
   c. If the priority is lowered, the thread becomes the head of the
      thread list.
]]

(Note that the preceding points mention variously sched_setscheduler(),
sched_setsparam(), and pthread_setschedprio(), so that the mention of
just pthread_setschedprio() in points 7 and 8 is significant.)

Now, since chrt(1) uses sched_setscheduler(), rather than
pthread_setschedprio(), then arguably the Linux behavior is a
violation of POSIX. (Indeed, buried in the man-pages source, I find
that I many years ago wrote the comment:

    In 2.2.x and 2.4.x, the thread is placed at the front of the queue
    In 2.0.x, the Right Thing happened: the thread went to the back -- MTK

But the Linux behavior seems reasonable to me and I'm inclined
to just document it (see the patch below).

Reported-by: Andrea Parri <parri.andrea@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-01-09 19:46:28 +01:00
Michael Kerrisk ffbfb5abd4 udplite.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-01-06 23:01:45 +01:00
Michael Kerrisk 6f9c4ef241 pty.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-01-06 23:00:52 +01:00
Michael Kerrisk 2468f14e4b cgroups.7: Relocate the 'Cgroups v2 "no internal processes" rule' subsection
Logically, this section should follow the section that
describes cgroup.subtree_control.

No content changes in this patch.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-27 06:32:48 +01:00
Michael Kerrisk 4f017a682c cgroups.7: Elaborate on the "no internal processes" rule
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-27 06:32:48 +01:00
Michael Kerrisk c9b101d1a2 cgroups.7: Mention ENOENT error that can occur when writing to subtree_control file
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-27 06:32:48 +01:00
Michael Kerrisk 4242dfbe4f cgroups.7: Add subsection describing cgroups v2 subtree delegation
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-27 06:32:48 +01:00
Michael Kerrisk ccb1a2621b cgroups.7: Minor rewording
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-23 14:09:00 +01:00
Michael Kerrisk 8d5f42dc46 cgroups.7: Rewrite the description of cgroup v2 subtree control
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-23 13:41:39 +01:00
Michael Kerrisk 57cbb0dbb0 cgroups.7: One may need to unmount v1 controllers before they can be used in v2
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-23 10:58:08 +01:00
Michael Kerrisk 75a12bb537 cgroups.7: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-23 10:39:36 +01:00
Michael Kerrisk 7409b54bdd cgroups.7: Add a section on unmounting cgroup v1 filesystems
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-23 10:27:11 +01:00
Michael Kerrisk 783a40b677 cgroups.7: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-23 09:34:14 +01:00
Michael Kerrisk 03bb1264cd cgroups.7: Note that systemd(1) nowadays automatically mount the cgroup2 filesystem
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-23 09:29:45 +01:00
Michael Kerrisk 2e33b59ee3 cgroups.7: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-23 09:09:41 +01:00
Michael Kerrisk 4769a77817 cgroups.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-23 09:09:26 +01:00
Michael Kerrisk 44c429ed45 cgroups.7: Add list of currently available version 2 controllers
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-23 09:07:00 +01:00
Michael Kerrisk d5034243fa sched.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-19 10:22:09 +01:00
Michael Kerrisk 286bdd7ca2 sched.7: Remove a mention of SCHED_RR in discussion of priority changes
Later in the page it is stated that SCHED_RR is the same as SCHED_FIFO.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-19 10:19:39 +01:00
Michael Kerrisk 329c0e77d1 sched.7: Minor clarifications
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-19 09:04:26 +01:00
Michael Kerrisk cb57fbc284 ip.7: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-18 17:43:54 +01:00
Michael Kerrisk 5d0ea688e3 ip.7: s/INADDR_ANY/INADDR_LOOPBACK/ in discussion of htonl()
INADDR_LOOPBACK is a better example, since it is not
byte-order neutral.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-18 17:39:02 +01:00
Ricardo Biehl Pasquali c0a0e532ae ip.7: INADDR_* values cannot be assigned directly to 's_addr'
According to The Open Group Base Specifications Issue 7, RATIONALE
section of
http://pubs.opengroup.org/onlinepubs/9699919799/ basedefs/netinet_in.h.html
some INADDR_* values must be converted using htonl().

INADDR_ANY and INADDR_BROADCAST are byte-order-neutral so they do
not require htonl(), however I only comment this fact in NOTES.
On the text I recommend to use htonl(), "even if for some subset
it's not necessary".

Signed-off-by: Ricardo Biehl Pasquali <pasqualirb@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-18 17:36:57 +01:00
Michael Kerrisk bd05436994 fifo.7: wfix
Reported-by: Adam Liddell <ml+kernel.org@aliddell.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-18 17:16:34 +01:00
Michael Kerrisk d145c0250b cgroups.7: Minor rewording
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-18 17:14:49 +01:00
Nikolay Borisov cfec905ed7 cgroups.7: Add information about RDMA controller
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-18 17:11:47 +01:00