tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Documenting the kern.sched sysctl tree [patch]



I like it.  See below for some detailed comment.

On Sun, 1 Jan 2017, Hubert Feyrer wrote:


Hi,

currently the kern.sched sysctl tree is not documented at all.
The patch below changes this. Changes, updates and suggestions welcome!

Here's what the formatted text looks like, for easier feedback:

    kern.sched (dynamic)
Influence the scheduling of LWPs, their priorisation and how they
            are distributed on and moved between CPUs.

                  Third level name              Type       Changeable
                  kern.sched.cacheht_time       integer    yes
                  kern.sched.balance_period     integer    yes
                  kern.sched.average_weight     integer    yes
                  kern.sched.min_catch          integer    yes
                  kern.sched.timesoftints       integer    yes
                  kern.sched.kpreempt_pri       integer    yes
                  kern.sched.upreempt_pri       integer    yes
                  kern.sched.maxts              integer    yes
                  kern.sched.mints              integer    yes
                  kern.sched.name               string     no
                  kern.sched.rtts               integer    no
                  kern.sched.pri_min            integer    no
                  kern.sched.pri_max            integer    no

            The variables are as follows:

            kern.sched.cacheht_time (dynamic)
                    Cache hotness time in which a LPW is kept on one
Typo -----------------------------------------------^^^

particu-
                    lar CPU and not moved to another CPU. This reduces the
                    overhead of flushing and reloading caches.  Defaults to
                    3ms.  Needs to be given in ``hz'' units, see mstohz(9).

            kern.sched.balance_period (dynamic)
                    Interval in which the CPU queues are checked for re-bal-
Usage - us "at" vs "in --------^^

                    ancing.  Defaults to 300ms.  Needs to be given in ``hz''
                    units, see mstohz(9).

            kern.sched.average_weight (dynamic)
                    Can be used to influence how likely LWPs can be migrated
Usage - "are to be" vs "can be" -------------------------------^^^^^^

                    from one CPU's queue of LPSs that are ready to run to a
What's an "LPS"? -----------------------------^^^
                    different, idle CPU.  The value gives the percentage for
                    weighting the average count of migratable threads from
                    the past against the current number of migratable
                    threads.  Small gives more weight to the past, big
Usage - "A smaller value" vs ---^^^^^  *** and "larger" vs "big" ----^^^

values
more weight on the current situation. Defaults to 50 and
                    must be between 0 and 100.

            kern.sched.min_catch (dynamic)
                    Minimum count of migratable (runable) threads for catch-
                    ing (stealing) from another CPU.  Defaults to 1 but can
                    be increased to decrease chance of thread migration
                    between CPUs.

            kern.sched.timesoftints (dynamic)
                    This switch allows to enable tracking of CPU time for
Remove ---------------^^^^^^^^^^^^^^^^^^^^^
(it's inconsistent with the remaining entries)

                    soft interrupts as part of a LWP's real execution time.
                    Set to a non-zero value to enable, and see ps(1) for
                    printing CPU times.

            kern.sched.kpreempt_pri (dynamic)
                    Minimum priority to trigger kernel preemption.

            kern.sched.upreempt_pri (dynamic)
                    Minimum priority to trigger user preemption.

            kern.sched.maxts (dynamic)
                    Scheduler specific maximal time quantum (in millisec-
                    onds).  Must be set to a value larger than ``mints'' and
                    between 10 and ``hz'' as given by the ``kern.clockrate''
Use .Dv markup for the sysctl names?

                    sysctl.  Provided by the M2 scheduler.

            kern.sched.mints (dynamic)
                    Scheduler specific minimal time quantum (in millisec-
onds). Must be set to a value smaller than ``maxts'' and
                    between 1 and ``hz'' as given by the ``kern.clockrate''
                    sysctl.  Provided by the M2 scheduler.

            kern.sched.name (dynamic)
                    Scheduler name.  Provided both by the M2 and the 4BSD
                    scheduler.

            kern.sched.rtts (dynamic)
Fixed scheduler specific round-robin time quantum in mil-
                    liseconds.  Provided both by the M2 and the 4BSD sched-
                    uler.

            kern.sched.pri_min (dynamic)
                    Minimal POSIX real-time priority.  See sched(3).

            kern.sched.pri_max (dynamic)
                    Maximal POSIX real-time priority.  See sched(3).


- Hubert


Index: sysctl.7
===================================================================
RCS file: /cvsroot/src/share/man/man7/sysctl.7,v
retrieving revision 1.104
diff -u -r1.104 sysctl.7
--- sysctl.7	17 Nov 2016 01:22:00 -0000	1.104
+++ sysctl.7	1 Jan 2017 22:19:46 -0000
@@ -355,7 +355,7 @@
.It kern.rtc_offset	integer	yes
.It kern.saved_ids	integer	no
.It kern.sbmax	integer	yes
-.\".It kern.sched	node	not applicable
+.It kern.sched	node	not applicable
.It kern.securelevel	integer	raise only
.It kern.somaxkva	integer	yes
.It kern.synchronized_io	integer	no
@@ -1034,8 +1034,104 @@
.It Li kern.securelevel ( Dv KERN_SECURELVL )
See
.Xr secmodel_securelevel 9 .
-.\" .It Li kern.sched
-.\" XXX: Undocumented.
+.It Li kern.sched ( dynamic )
+Influence the scheduling of LWPs, their priorisation and how they are
+distributed on and moved between CPUs.
+.Bl -column "kern.sched.balance_period" "integer" "Changeable" -offset indent
+.It Sy Third level name	   Sy Type	 Sy Changeable
+.It kern.sched.cacheht_time	   integer	 yes
+.It kern.sched.balance_period	   integer	 yes
+.It kern.sched.average_weight	   integer	 yes
+.It kern.sched.min_catch	   integer	 yes
+.It kern.sched.timesoftints	   integer	 yes
+.It kern.sched.kpreempt_pri	   integer	 yes
+.It kern.sched.upreempt_pri	   integer	 yes
+.It kern.sched.maxts	   integer	 yes
+.It kern.sched.mints integer yes +.It kern.sched.name string no +.It kern.sched.rtts integer no
+.It kern.sched.pri_min	   integer	 no
+.It kern.sched.pri_max	   integer	 no
+.El
+.Pp
+The variables are as follows:
+.Bl -tag -width "123456"
+.It Li kern.sched.cacheht_time ( dynamic )
+Cache hotness time in which a LPW is kept on one particular CPU
+and not moved to another CPU. This reduces the overhead of flushing
+and reloading caches. +Defaults to 3ms.
+Needs to be given in +.Dq hz
+units, see
+.Xr mstohz 9 .
+.It Li kern.sched.balance_period ( dynamic )
+Interval in which the CPU queues are checked for re-balancing.
+Defaults to 300ms.
+Needs to be given in +.Dq hz
+units, see
+.Xr mstohz 9 .
+.It Li kern.sched.average_weight ( dynamic )
+Can be used to influence how likely LWPs can be migrated from
+one CPU's queue of LPSs that are ready to run to a different, idle CPU. +The value gives the percentage for weighting the average count of
+migratable threads from the past against the current number of
+migratable threads. +Small gives more weight to the past, big values more weight on the
+current situation.
+Defaults to 50 and must be between 0 and 100. +.It Li kern.sched.min_catch ( dynamic )
+Minimum count of migratable (runable) threads for catching (stealing)
+from another CPU.
+Defaults to 1 but can be increased to decrease chance of thread
+migration between CPUs. +.It Li kern.sched.timesoftints ( dynamic )
+This switch allows to enable tracking of CPU time for soft interrupts
+as part of a LWP's real execution time.
+Set to a non-zero value to enable,
+and see
+.Xr ps 1
+for printing CPU times.
+.It Li kern.sched.kpreempt_pri ( dynamic )
+Minimum priority to trigger kernel preemption.
+.It Li kern.sched.upreempt_pri ( dynamic )
+Minimum priority to trigger user preemption.
+.It Li kern.sched.maxts ( dynamic )
+Scheduler specific maximal time quantum (in milliseconds).
+Must be set to a value larger than
+.Dq mints
+and between 10 and
+.Dq hz +as given by the
+.Dq kern.clockrate
+sysctl.
+Provided by the M2 scheduler.
+.It Li kern.sched.mints ( dynamic )
+Scheduler specific minimal time quantum (in milliseconds).
+Must be set to a value smaller than
+.Dq maxts
+and between 1 and
+.Dq hz +as given by the
+.Dq kern.clockrate
+sysctl.
+Provided by the M2 scheduler.
+.It Li kern.sched.name ( dynamic )
+Scheduler name. +Provided both by the M2 and the 4BSD scheduler.
+.It Li kern.sched.rtts ( dynamic )
+Fixed scheduler specific round-robin time quantum in milliseconds.
+Provided both by the M2 and the 4BSD scheduler.
+.It Li kern.sched.pri_min ( dynamic )
+Minimal POSIX real-time priority.
+See
+.Xr sched 3 .
+.It Li kern.sched.pri_max ( dynamic )
+Maximal POSIX real-time priority.
+See
+.Xr sched 3 .
+.El
.It Li kern.somaxkva ( Dv KERN_SOMAXKVA )
Maximum amount of kernel memory to be used for socket buffers.
.\" XXX units?


!DSPAM:5869817c81604689992798!



+------------------+--------------------------+------------------------+
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:      |
| (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com   |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd.org |
+------------------+--------------------------+------------------------+


Home | Main Index | Thread Index | Old Index