Linux Manual Pages development
 help / color / mirror / Atom feed
* [PATCH] man7, man2: document SCHED_EXT policy
@ 2026-04-12 18:16 Cheng-Yang Chou
  2026-04-22 16:02 ` Alejandro Colomar
  0 siblings, 1 reply; 10+ messages in thread
From: Cheng-Yang Chou @ 2026-04-12 18:16 UTC (permalink / raw)
  To: Alejandro Colomar
  Cc: linux-man, sched-ext, Tejun Heo, David Vernet, Andrea Righi,
	Changwoo Min, Ching-Chun Huang, Chia-Ping Tsai, yphbchou0911

Add the sched_ext(7) manual page and update existing scheduling
documentation to include the SCHED_EXT policy.

Signed-off-by: Cheng-Yang Chou <yphbchou0911@gmail.com>
---
 man/man2/sched_setattr.2      |  11 +++-
 man/man2/sched_setscheduler.2 |   4 ++
 man/man7/sched.7              |  13 +++++
 man/man7/sched_ext.7          | 100 ++++++++++++++++++++++++++++++++++
 4 files changed, 126 insertions(+), 2 deletions(-)
 create mode 100644 man/man7/sched_ext.7

diff --git a/man/man2/sched_setattr.2 b/man/man2/sched_setattr.2
index 80a0ac726dcf..d60678f00e72 100644
--- a/man/man2/sched_setattr.2
+++ b/man/man2/sched_setattr.2
@@ -81,6 +81,10 @@ a deadline scheduling policy;
 see
 .BR sched (7)
 for details.
+.TP 14
+.B SCHED_EXT
+for extensible scheduling policies implemented via BPF
+(see \fBsched_ext\fR(7)).
 .P
 The
 .I attr
@@ -95,7 +99,8 @@ struct sched_attr {
     u32 sched_policy;      /* Policy (SCHED_*) */
     u64 sched_flags;       /* Flags */
     s32 sched_nice;        /* Nice value (SCHED_OTHER,
-                              SCHED_BATCH) */
+                              SCHED_BATCH,
+                              SCHED_EXT) */
     u32 sched_priority;    /* Static priority (SCHED_FIFO,
                               SCHED_RR) */
     /* For SCHED_DEADLINE */
@@ -218,8 +223,10 @@ This field specifies the nice value to be set when specifying
 .I sched_policy
 as
 .B SCHED_OTHER
+,
+.BR SCHED_BATCH ,
 or
-.BR SCHED_BATCH .
+.BR SCHED_EXT .
 The nice value is a number in the range \-20 (high priority)
 to +19 (low priority);
 see
diff --git a/man/man2/sched_setscheduler.2 b/man/man2/sched_setscheduler.2
index b4c35543e5bf..825eb7290ee7 100644
--- a/man/man2/sched_setscheduler.2
+++ b/man/man2/sched_setscheduler.2
@@ -67,6 +67,10 @@ and
 for running
 .I very
 low priority background jobs.
+.TP
+.B SCHED_EXT
+for extensible scheduling policies implemented via BPF
+(see \fBsched_ext\fR(7)).
 .P
 For each of the above policies,
 .I param\->sched_priority
diff --git a/man/man7/sched.7 b/man/man7/sched.7
index 00926cd34ecf..2e73a4c716b9 100644
--- a/man/man7/sched.7
+++ b/man/man7/sched.7
@@ -116,6 +116,13 @@ and
 .BR sched_get_priority_max (2)
 to find the range of priorities supported for a particular policy.
 .P
+Since Linux 6.12, there is an extensible BPF scheduling policy
+.RB ( SCHED_EXT ),
+which allows for custom scheduling algorithms to be implemented as BPF
+programs.
+See
+.BR sched_ext (7).
+.P
 Conceptually,
 the scheduler maintains a list of runnable threads for each possible
 .I sched_priority
@@ -529,6 +536,12 @@ priority (lower even than a +19 nice value with the
 or
 .B SCHED_BATCH
 policies).
+.SS SCHED_EXT: Extensible BPF Scheduling
+Tasks with this policy are managed by an extensible scheduler class,
+which allows for custom scheduling algorithms to be implemented as
+BPF programs.
+See
+.BR sched_ext (7).
 .\"
 .SS Resetting scheduling policy for child processes
 Each thread has a reset-on-fork scheduling flag.
diff --git a/man/man7/sched_ext.7 b/man/man7/sched_ext.7
new file mode 100644
index 000000000000..7ea467e18b84
--- /dev/null
+++ b/man/man7/sched_ext.7
@@ -0,0 +1,100 @@
+.TH SCHED_EXT 7 2024-04-13 "Linux" "Linux Programmer's Manual"
+.SH NAME
+sched_ext \- Extensible BPF Scheduler Class
+.SH SYNOPSIS
+.B #include <linux/sched.h>
+.PP
+.B #define SCHED_EXT 7
+.SH DESCRIPTION
+.B sched_ext
+is a scheduling class whose behavior can be defined by a set of BPF
+programs, known as the BPF scheduler. It allows for the implementation
+of custom scheduling algorithms that can be loaded and unloaded
+dynamically.
+.PP
+When a BPF scheduler is loaded, it can take over the scheduling of
+tasks that use the
+.B SCHED_EXT
+policy, as well as tasks using standard policies like
+.BR SCHED_NORMAL ,
+.BR SCHED_BATCH ,
+and
+.B SCHED_IDLE ,
+depending on how the BPF scheduler is configured.
+.SS Switching to and from sched_ext
+The feature is enabled via the
+.B CONFIG_SCHED_CLASS_EXT
+kernel configuration option.
+.PP
+A task can explicitly request the
+.B SCHED_EXT
+policy using system calls such as
+.BR sched_setscheduler (2)
+or
+.BR sched_setattr (2).
+If no BPF scheduler is currently loaded, tasks with the
+.B SCHED_EXT
+policy are treated as
+.B SCHED_NORMAL
+and scheduled by the default fair-class scheduler (CFS/EEVDF).
+.PP
+When a BPF scheduler is loaded:
+.IP \(bu 3
+If
+.B SCX_OPS_SWITCH_PARTIAL
+is NOT set in the scheduler's flags, ALL tasks with policies
+.BR SCHED_NORMAL ,
+.BR SCHED_BATCH ,
+.BR SCHED_IDLE ,
+and
+.B SCHED_EXT
+are scheduled by
+.BR sched_ext .
+.IP \(bu 3
+If
+.B SCX_OPS_SWITCH_PARTIAL
+IS set, only tasks with the
+.B SCHED_EXT
+policy are scheduled by
+.BR sched_ext .
+Tasks with other policies remain under the control of the fair-class scheduler.
+.PP
+If the BPF scheduler terminates (either normally, due to an error, or
+via a SysRq command), all tasks are automatically reverted to the
+fair-class scheduler.
+.SS System Interfaces
+.B sched_ext
+exposes several interfaces in sysfs for monitoring and control:
+.TP
+.I /sys/kernel/sched_ext/state
+Shows the current state of the BPF scheduler (\fBenabled\fR, \fBdisabled\fR, etc.).
+.TP
+.I /sys/kernel/sched_ext/root/ops
+Shows the name of the currently loaded BPF scheduler.
+.TP
+.I /sys/kernel/sched_ext/enable_seq
+A monotonically incrementing counter that tracks how many times a BPF
+scheduler has been enabled since boot.
+.SS Safety and Debugging
+System integrity is maintained regardless of the BPF scheduler's
+behavior. If a runnable task stalls or an internal error is detected,
+the BPF scheduler is aborted.
+.PP
+The following SysRq sequences are available for emergency management:
+.TP
+.B SysRq-S
+Aborts the current BPF scheduler and reverts all tasks to the fair-class
+scheduler.
+.TP
+.B SysRq-D
+Triggers a debug dump of the current scheduler state to the
+.B sched_ext_dump
+tracepoint.
+.SH SEE ALSO
+.BR sched (7),
+.BR sched_setscheduler (2),
+.BR sched_setattr (2),
+.BR bpf (2)
+.PP
+.I Documentation/scheduler/sched-ext.rst
+in the Linux kernel source tree.
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] man7, man2: document SCHED_EXT policy
  2026-04-12 18:16 [PATCH] man7, man2: document SCHED_EXT policy Cheng-Yang Chou
@ 2026-04-22 16:02 ` Alejandro Colomar
  2026-04-22 16:13   ` Cheng-Yang Chou
  2026-04-22 16:46   ` Cheng-Yang Chou
  0 siblings, 2 replies; 10+ messages in thread
From: Alejandro Colomar @ 2026-04-22 16:02 UTC (permalink / raw)
  To: Cheng-Yang Chou
  Cc: linux-man, sched-ext, Tejun Heo, David Vernet, Andrea Righi,
	Changwoo Min, Ching-Chun Huang, Chia-Ping Tsai

[-- Attachment #1: Type: text/plain, Size: 7220 bytes --]

Hi Cheng-Yang,

On 2026-04-13T02:16:58+0800, Cheng-Yang Chou wrote:
> Add the sched_ext(7) manual page and update existing scheduling
> documentation to include the SCHED_EXT policy.
> 
> Signed-off-by: Cheng-Yang Chou <yphbchou0911@gmail.com>
> ---
>  man/man2/sched_setattr.2      |  11 +++-
>  man/man2/sched_setscheduler.2 |   4 ++
>  man/man7/sched.7              |  13 +++++
>  man/man7/sched_ext.7          | 100 ++++++++++++++++++++++++++++++++++
>  4 files changed, 126 insertions(+), 2 deletions(-)
>  create mode 100644 man/man7/sched_ext.7
> 
> diff --git a/man/man2/sched_setattr.2 b/man/man2/sched_setattr.2
> index 80a0ac726dcf..d60678f00e72 100644
> --- a/man/man2/sched_setattr.2
> +++ b/man/man2/sched_setattr.2
> @@ -81,6 +81,10 @@ a deadline scheduling policy;
>  see
>  .BR sched (7)
>  for details.
> +.TP 14
> +.B SCHED_EXT
> +for extensible scheduling policies implemented via BPF
> +(see \fBsched_ext\fR(7)).

Please follow the style within that manual page.  We avoid \f unless
truly necessary.

>  .P
>  The
>  .I attr
> @@ -95,7 +99,8 @@ struct sched_attr {
>      u32 sched_policy;      /* Policy (SCHED_*) */
>      u64 sched_flags;       /* Flags */
>      s32 sched_nice;        /* Nice value (SCHED_OTHER,
> -                              SCHED_BATCH) */
> +                              SCHED_BATCH,
> +                              SCHED_EXT) */

Why break the line?

>      u32 sched_priority;    /* Static priority (SCHED_FIFO,
>                                SCHED_RR) */
>      /* For SCHED_DEADLINE */
> @@ -218,8 +223,10 @@ This field specifies the nice value to be set when specifying
>  .I sched_policy
>  as
>  .B SCHED_OTHER
> +,

What's the reason for this weird formatting of the source code?  At this
point I wonder if this was generated by AI.

Please take into account 'CONTRIBUTING.d/ai'.

> +.BR SCHED_BATCH ,
>  or
> -.BR SCHED_BATCH .
> +.BR SCHED_EXT .
>  The nice value is a number in the range \-20 (high priority)
>  to +19 (low priority);
>  see
> diff --git a/man/man2/sched_setscheduler.2 b/man/man2/sched_setscheduler.2
> index b4c35543e5bf..825eb7290ee7 100644
> --- a/man/man2/sched_setscheduler.2
> +++ b/man/man2/sched_setscheduler.2
> @@ -67,6 +67,10 @@ and
>  for running
>  .I very
>  low priority background jobs.
> +.TP
> +.B SCHED_EXT
> +for extensible scheduling policies implemented via BPF
> +(see \fBsched_ext\fR(7)).

Please check formatting.

>  .P
>  For each of the above policies,
>  .I param\->sched_priority
> diff --git a/man/man7/sched.7 b/man/man7/sched.7
> index 00926cd34ecf..2e73a4c716b9 100644
> --- a/man/man7/sched.7
> +++ b/man/man7/sched.7
> @@ -116,6 +116,13 @@ and
>  .BR sched_get_priority_max (2)
>  to find the range of priorities supported for a particular policy.
>  .P
> +Since Linux 6.12, there is an extensible BPF scheduling policy
> +.RB ( SCHED_EXT ),
> +which allows for custom scheduling algorithms to be implemented as BPF
> +programs.
> +See
> +.BR sched_ext (7).
> +.P
>  Conceptually,
>  the scheduler maintains a list of runnable threads for each possible
>  .I sched_priority
> @@ -529,6 +536,12 @@ priority (lower even than a +19 nice value with the
>  or
>  .B SCHED_BATCH
>  policies).
> +.SS SCHED_EXT: Extensible BPF Scheduling
> +Tasks with this policy are managed by an extensible scheduler class,
> +which allows for custom scheduling algorithms to be implemented as
> +BPF programs.
> +See
> +.BR sched_ext (7).
>  .\"
>  .SS Resetting scheduling policy for child processes
>  Each thread has a reset-on-fork scheduling flag.
> diff --git a/man/man7/sched_ext.7 b/man/man7/sched_ext.7
> new file mode 100644
> index 000000000000..7ea467e18b84
> --- /dev/null
> +++ b/man/man7/sched_ext.7
> @@ -0,0 +1,100 @@
> +.TH SCHED_EXT 7 2024-04-13 "Linux" "Linux Programmer's Manual"
> +.SH NAME
> +sched_ext \- Extensible BPF Scheduler Class
> +.SH SYNOPSIS
> +.B #include <linux/sched.h>
> +.PP

The use of P and PP seems very inconsistent.


Have a lovely day!
Alex

> +.B #define SCHED_EXT 7
> +.SH DESCRIPTION
> +.B sched_ext
> +is a scheduling class whose behavior can be defined by a set of BPF
> +programs, known as the BPF scheduler. It allows for the implementation
> +of custom scheduling algorithms that can be loaded and unloaded
> +dynamically.
> +.PP
> +When a BPF scheduler is loaded, it can take over the scheduling of
> +tasks that use the
> +.B SCHED_EXT
> +policy, as well as tasks using standard policies like
> +.BR SCHED_NORMAL ,
> +.BR SCHED_BATCH ,
> +and
> +.B SCHED_IDLE ,
> +depending on how the BPF scheduler is configured.
> +.SS Switching to and from sched_ext
> +The feature is enabled via the
> +.B CONFIG_SCHED_CLASS_EXT
> +kernel configuration option.
> +.PP
> +A task can explicitly request the
> +.B SCHED_EXT
> +policy using system calls such as
> +.BR sched_setscheduler (2)
> +or
> +.BR sched_setattr (2).
> +If no BPF scheduler is currently loaded, tasks with the
> +.B SCHED_EXT
> +policy are treated as
> +.B SCHED_NORMAL
> +and scheduled by the default fair-class scheduler (CFS/EEVDF).
> +.PP
> +When a BPF scheduler is loaded:
> +.IP \(bu 3
> +If
> +.B SCX_OPS_SWITCH_PARTIAL
> +is NOT set in the scheduler's flags, ALL tasks with policies
> +.BR SCHED_NORMAL ,
> +.BR SCHED_BATCH ,
> +.BR SCHED_IDLE ,
> +and
> +.B SCHED_EXT
> +are scheduled by
> +.BR sched_ext .
> +.IP \(bu 3
> +If
> +.B SCX_OPS_SWITCH_PARTIAL
> +IS set, only tasks with the
> +.B SCHED_EXT
> +policy are scheduled by
> +.BR sched_ext .
> +Tasks with other policies remain under the control of the fair-class scheduler.
> +.PP
> +If the BPF scheduler terminates (either normally, due to an error, or
> +via a SysRq command), all tasks are automatically reverted to the
> +fair-class scheduler.
> +.SS System Interfaces
> +.B sched_ext
> +exposes several interfaces in sysfs for monitoring and control:
> +.TP
> +.I /sys/kernel/sched_ext/state
> +Shows the current state of the BPF scheduler (\fBenabled\fR, \fBdisabled\fR, etc.).
> +.TP
> +.I /sys/kernel/sched_ext/root/ops
> +Shows the name of the currently loaded BPF scheduler.
> +.TP
> +.I /sys/kernel/sched_ext/enable_seq
> +A monotonically incrementing counter that tracks how many times a BPF
> +scheduler has been enabled since boot.
> +.SS Safety and Debugging
> +System integrity is maintained regardless of the BPF scheduler's
> +behavior. If a runnable task stalls or an internal error is detected,
> +the BPF scheduler is aborted.
> +.PP
> +The following SysRq sequences are available for emergency management:
> +.TP
> +.B SysRq-S
> +Aborts the current BPF scheduler and reverts all tasks to the fair-class
> +scheduler.
> +.TP
> +.B SysRq-D
> +Triggers a debug dump of the current scheduler state to the
> +.B sched_ext_dump
> +tracepoint.
> +.SH SEE ALSO
> +.BR sched (7),
> +.BR sched_setscheduler (2),
> +.BR sched_setattr (2),
> +.BR bpf (2)
> +.PP
> +.I Documentation/scheduler/sched-ext.rst
> +in the Linux kernel source tree.
> -- 
> 2.48.1
> 

-- 
<https://www.alejandro-colomar.es>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] man7, man2: document SCHED_EXT policy
  2026-04-22 16:02 ` Alejandro Colomar
@ 2026-04-22 16:13   ` Cheng-Yang Chou
  2026-04-22 16:36     ` G. Branden Robinson
  2026-04-22 16:46   ` Cheng-Yang Chou
  1 sibling, 1 reply; 10+ messages in thread
From: Cheng-Yang Chou @ 2026-04-22 16:13 UTC (permalink / raw)
  To: Alejandro Colomar
  Cc: linux-man, sched-ext, Tejun Heo, David Vernet, Andrea Righi,
	Changwoo Min, Ching-Chun Huang, Chia-Ping Tsai

Hi Alejandro,

On Wed, Apr 22, 2026 at 06:02:49PM +0200, Alejandro Colomar wrote:
> > diff --git a/man/man2/sched_setattr.2 b/man/man2/sched_setattr.2
> > index 80a0ac726dcf..d60678f00e72 100644
> > --- a/man/man2/sched_setattr.2
> > +++ b/man/man2/sched_setattr.2
> > @@ -81,6 +81,10 @@ a deadline scheduling policy;
> >  see
> >  .BR sched (7)
> >  for details.
> > +.TP 14
> > +.B SCHED_EXT
> > +for extensible scheduling policies implemented via BPF
> > +(see \fBsched_ext\fR(7)).
> 
> Please follow the style within that manual page.  We avoid \f unless
> truly necessary.

Ack! This is my first time contributing here, so I'm still catching up
on the specific style rules.
> 
> >  .P
> >  The
> >  .I attr
> > @@ -95,7 +99,8 @@ struct sched_attr {
> >      u32 sched_policy;      /* Policy (SCHED_*) */
> >      u64 sched_flags;       /* Flags */
> >      s32 sched_nice;        /* Nice value (SCHED_OTHER,
> > -                              SCHED_BATCH) */
> > +                              SCHED_BATCH,
> > +                              SCHED_EXT) */
> 
> Why break the line?
> 
> >      u32 sched_priority;    /* Static priority (SCHED_FIFO,
> >                                SCHED_RR) */
> >      /* For SCHED_DEADLINE */
> > @@ -218,8 +223,10 @@ This field specifies the nice value to be set when specifying
> >  .I sched_policy
> >  as
> >  .B SCHED_OTHER
> > +,
> 
> What's the reason for this weird formatting of the source code?  At this
> point I wonder if this was generated by AI.

Yes, I used AI for the formatting, which I should disclose it, hence the
weird layout. Apologies for that. I believe the content is solid, but the
style needs adjusting. I'll send a v2. Thanks.

> Please take into account 'CONTRIBUTING.d/ai'.
> 
> > +.BR SCHED_BATCH ,
> >  or
> > -.BR SCHED_BATCH .
> > +.BR SCHED_EXT .
> >  The nice value is a number in the range \-20 (high priority)
> >  to +19 (low priority);
> >  see
> > diff --git a/man/man2/sched_setscheduler.2 b/man/man2/sched_setscheduler.2
> > index b4c35543e5bf..825eb7290ee7 100644
> > --- a/man/man2/sched_setscheduler.2
> > +++ b/man/man2/sched_setscheduler.2
> > @@ -67,6 +67,10 @@ and
> >  for running
> >  .I very
> >  low priority background jobs.
> > +.TP
> > +.B SCHED_EXT
> > +for extensible scheduling policies implemented via BPF
> > +(see \fBsched_ext\fR(7)).
> 
> Please check formatting.

Ack.

> >  .P
> >  For each of the above policies,
> >  .I param\->sched_priority
> > diff --git a/man/man7/sched.7 b/man/man7/sched.7
> > index 00926cd34ecf..2e73a4c716b9 100644
> > --- a/man/man7/sched.7
> > +++ b/man/man7/sched.7
> > @@ -116,6 +116,13 @@ and
> >  .BR sched_get_priority_max (2)
> >  to find the range of priorities supported for a particular policy.
> >  .P
> > +Since Linux 6.12, there is an extensible BPF scheduling policy
> > +.RB ( SCHED_EXT ),
> > +which allows for custom scheduling algorithms to be implemented as BPF
> > +programs.
> > +See
> > +.BR sched_ext (7).
> > +.P
> >  Conceptually,
> >  the scheduler maintains a list of runnable threads for each possible
> >  .I sched_priority
> > @@ -529,6 +536,12 @@ priority (lower even than a +19 nice value with the
> >  or
> >  .B SCHED_BATCH
> >  policies).
> > +.SS SCHED_EXT: Extensible BPF Scheduling
> > +Tasks with this policy are managed by an extensible scheduler class,
> > +which allows for custom scheduling algorithms to be implemented as
> > +BPF programs.
> > +See
> > +.BR sched_ext (7).
> >  .\"
> >  .SS Resetting scheduling policy for child processes
> >  Each thread has a reset-on-fork scheduling flag.
> > diff --git a/man/man7/sched_ext.7 b/man/man7/sched_ext.7
> > new file mode 100644
> > index 000000000000..7ea467e18b84
> > --- /dev/null
> > +++ b/man/man7/sched_ext.7
> > @@ -0,0 +1,100 @@
> > +.TH SCHED_EXT 7 2024-04-13 "Linux" "Linux Programmer's Manual"
> > +.SH NAME
> > +sched_ext \- Extensible BPF Scheduler Class
> > +.SH SYNOPSIS
> > +.B #include <linux/sched.h>
> > +.PP
> 
> The use of P and PP seems very inconsistent.
> 

Ack.

-- 
Cheers,
Cheng-Yang

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] man7, man2: document SCHED_EXT policy
  2026-04-22 16:13   ` Cheng-Yang Chou
@ 2026-04-22 16:36     ` G. Branden Robinson
  2026-04-22 16:59       ` Alejandro Colomar
  0 siblings, 1 reply; 10+ messages in thread
From: G. Branden Robinson @ 2026-04-22 16:36 UTC (permalink / raw)
  To: Alejandro Colomar, linux-man

[-- Attachment #1: Type: text/plain, Size: 1130 bytes --]

[stripping distribution down to just the linux-man list and Alex]

At 2026-04-23T00:13:57+0800, Cheng-Yang Chou wrote:
> On Wed, Apr 22, 2026 at 06:02:49PM +0200, Alejandro Colomar wrote:
> > > @@ -218,8 +223,10 @@ This field specifies the nice value to be set when specifying
> > >  .I sched_policy
> > >  as
> > >  .B SCHED_OTHER
> > > +,
> > 
> > What's the reason for this weird formatting of the source code?  At
> > this point I wonder if this was generated by AI.
> 
> Yes, I used AI for the formatting, which I should disclose it, hence
> the weird layout.

I don't know, man, I stuck a comma on a line by itself in a man page
just the other day.  ;-)

https://lists.gnu.org/archive/html/groff-commit/2026-04/msg00282.html

+We prefix macro names with
+_ifstyle()dnl
+a dot
+.RB ( . ),
+_endif()dnl
+the default
+.I roff
+control character\c
+_ifstyle()dnl
+,
+_endif()dnl
+_ifnotstyle()dnl
+\&
+_endif()dnl
+in summaries and synopses.

(Lest anyone hyperventilate, that's not a man(7) document per se, but an
m4(1) document that _generates_ a man(7) document.)

Regards,
Branden

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] man7, man2: document SCHED_EXT policy
  2026-04-22 16:02 ` Alejandro Colomar
  2026-04-22 16:13   ` Cheng-Yang Chou
@ 2026-04-22 16:46   ` Cheng-Yang Chou
  2026-04-22 17:04     ` Alejandro Colomar
  2026-04-22 17:04     ` G. Branden Robinson
  1 sibling, 2 replies; 10+ messages in thread
From: Cheng-Yang Chou @ 2026-04-22 16:46 UTC (permalink / raw)
  To: Alejandro Colomar
  Cc: linux-man, sched-ext, Tejun Heo, David Vernet, Andrea Righi,
	Changwoo Min, Ching-Chun Huang, Chia-Ping Tsai

Hi Alejandro,

On Wed, Apr 22, 2026 at 06:02:49PM +0200, Alejandro Colomar wrote:
> What's the reason for this weird formatting of the source code?  At this
> point I wonder if this was generated by AI.
> 
> Please take into account 'CONTRIBUTING.d/ai'.

Okay, after reading the AI policy doc carefully, I've decided to drop 
this patch. I used AI to help with the formatting since I'm not familiar
with the rules here.

I didn't realize this was strictly forbidden here, my apologies :/
Sorry for the noise, and thanks for your time!

-- 
Cheers,
Cheng-Yang

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] man7, man2: document SCHED_EXT policy
  2026-04-22 16:36     ` G. Branden Robinson
@ 2026-04-22 16:59       ` Alejandro Colomar
  2026-04-22 17:23         ` G. Branden Robinson
  0 siblings, 1 reply; 10+ messages in thread
From: Alejandro Colomar @ 2026-04-22 16:59 UTC (permalink / raw)
  To: G. Branden Robinson; +Cc: linux-man

[-- Attachment #1: Type: text/plain, Size: 2124 bytes --]

Hi Branden,

On 2026-04-22T11:36:03-0500, G. Branden Robinson wrote:
> [stripping distribution down to just the linux-man list and Alex]
> 
> At 2026-04-23T00:13:57+0800, Cheng-Yang Chou wrote:
> > On Wed, Apr 22, 2026 at 06:02:49PM +0200, Alejandro Colomar wrote:
> > > > @@ -218,8 +223,10 @@ This field specifies the nice value to be set when specifying
> > > >  .I sched_policy
> > > >  as
> > > >  .B SCHED_OTHER
> > > > +,
> > > 
> > > What's the reason for this weird formatting of the source code?  At
> > > this point I wonder if this was generated by AI.
> > 
> > Yes, I used AI for the formatting, which I should disclose it, hence
> > the weird layout.
> 
> I don't know, man, I stuck a comma on a line by itself in a man page
> just the other day.  ;-)

I've seen several other clues in the patch.  This was the once that
confirmed it to me.  At first I thought that maybe the contributor could
not know that BR exists, and thus try that naively (I've seen that done
in other patches).  However, 2 lines below there the patch introduced
a line using BR perfectly.  That very much read like random LLM stuff.

There was also the arbitrary combined use of .P and .PP.  I suspect no
human would use both in a document, unless the surrounding style already
uses both (which could confuse).  Since we only have .P, the .PP came
out of nowhere.

And then there's the extensive use of \f (without brackets) and \(bu, of
which we have no cases anymore.

All of this was very suspicious, so I had to ask.


Have a lovely day!
Alex

> 
> https://lists.gnu.org/archive/html/groff-commit/2026-04/msg00282.html
> 
> +We prefix macro names with
> +_ifstyle()dnl
> +a dot
> +.RB ( . ),
> +_endif()dnl
> +the default
> +.I roff
> +control character\c
> +_ifstyle()dnl
> +,
> +_endif()dnl
> +_ifnotstyle()dnl
> +\&
> +_endif()dnl
> +in summaries and synopses.
> 
> (Lest anyone hyperventilate, that's not a man(7) document per se, but an
> m4(1) document that _generates_ a man(7) document.)
> 
> Regards,
> Branden



-- 
<https://www.alejandro-colomar.es>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] man7, man2: document SCHED_EXT policy
  2026-04-22 16:46   ` Cheng-Yang Chou
@ 2026-04-22 17:04     ` Alejandro Colomar
  2026-04-22 17:04     ` G. Branden Robinson
  1 sibling, 0 replies; 10+ messages in thread
From: Alejandro Colomar @ 2026-04-22 17:04 UTC (permalink / raw)
  To: Cheng-Yang Chou
  Cc: linux-man, sched-ext, Tejun Heo, David Vernet, Andrea Righi,
	Changwoo Min, Ching-Chun Huang, Chia-Ping Tsai

[-- Attachment #1: Type: text/plain, Size: 1119 bytes --]

Hi Cheng-Yang,

On 2026-04-23T00:46:44+0800, Cheng-Yang Chou wrote:
> Hi Alejandro,
> 
> On Wed, Apr 22, 2026 at 06:02:49PM +0200, Alejandro Colomar wrote:
> > What's the reason for this weird formatting of the source code?  At this
> > point I wonder if this was generated by AI.
> > 
> > Please take into account 'CONTRIBUTING.d/ai'.
> 
> Okay, after reading the AI policy doc carefully, I've decided to drop 
> this patch. I used AI to help with the formatting since I'm not familiar
> with the rules here.
> 
> I didn't realize this was strictly forbidden here, my apologies :/
> Sorry for the noise, and thanks for your time!

No problem.  If you write it from scratch again, I'd welcome the patch.
If you follow the surrounding style, it shouldn't be too difficult.
It's intimidating at first, but the language is quite simple.  If you
don't understand much the man(7) language even after trying, I can help
format it myself with a decent draft.  Just let me know what you want to
do.


Cheers,
Alex

> 
> -- 
> Cheers,
> Cheng-Yang
> 

-- 
<https://www.alejandro-colomar.es>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] man7, man2: document SCHED_EXT policy
  2026-04-22 16:46   ` Cheng-Yang Chou
  2026-04-22 17:04     ` Alejandro Colomar
@ 2026-04-22 17:04     ` G. Branden Robinson
  1 sibling, 0 replies; 10+ messages in thread
From: G. Branden Robinson @ 2026-04-22 17:04 UTC (permalink / raw)
  To: Cheng-Yang Chou; +Cc: Alejandro Colomar, linux-man

[-- Attachment #1: Type: text/plain, Size: 946 bytes --]

Hi Cheng-Yang,

At 2026-04-23T00:46:44+0800, Cheng-Yang Chou wrote:
> On Wed, Apr 22, 2026 at 06:02:49PM +0200, Alejandro Colomar wrote:
> > What's the reason for this weird formatting of the source code?  At
> > this point I wonder if this was generated by AI.
> > 
> > Please take into account 'CONTRIBUTING.d/ai'.
> 
> Okay, after reading the AI policy doc carefully, I've decided to drop
> this patch. I used AI to help with the formatting since I'm not
> familiar with the rules here.

I urge you not to give up easily.  The man(7) language is not hard to
acquire, and the more you stick to time-tested idioms the easier it
gets.   Here's a guide I wrote over 20 years ago.

https://web.archive.org/web/20060102165607/http://people.debian.org/~branden/talks/wtfm/wtfm.pdf

I standy by most of it, notably excepting my spelling of "manpages" as
one word.  Oh, to be so young and callow again...  ;-)

Regards,
Branden

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] man7, man2: document SCHED_EXT policy
  2026-04-22 16:59       ` Alejandro Colomar
@ 2026-04-22 17:23         ` G. Branden Robinson
  2026-04-22 18:08           ` Alejandro Colomar
  0 siblings, 1 reply; 10+ messages in thread
From: G. Branden Robinson @ 2026-04-22 17:23 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: linux-man

[-- Attachment #1: Type: text/plain, Size: 2617 bytes --]

Hi Alex,

At 2026-04-22T18:59:01+0200, Alejandro Colomar wrote:
> I've seen several other clues in the patch.  This was the once that
> confirmed it to me.  At first I thought that maybe the contributor
> could not know that BR exists, and thus try that naively (I've seen
> that done in other patches).

Oh yes.  Ignorance of man(7)'s font alternation macros is regrettably
widespread.

All of the best people get along just fine with BR, let me assure you.

> However, 2 lines below there the patch introduced a line using BR
> perfectly.  That very much read like random LLM stuff.

Nice catch.  I like the way you sussed that out.  While humans are not
immune from this class of error (forgetting something you "knew" 60
seconds ago--maybe more like 60 nanoseconds in LLM time), it's uncommon
among mentally healthy people who haven't been hitting the "substances".

I'm reminded of how toddlers acquire object permanence.[1]  Not _quite_
the same thing, as abstract knowledge is more easily lost ("what are the
conventional units of the ideal gas constant?  how many operator
precedence levels does C have, again?")--but it seems close.

A course for people red-teaming LLMs to pursue, maybe.

> There was also the arbitrary combined use of .P and .PP.  I suspect no
> human would use both in a document, unless the surrounding style
> already uses both (which could confuse).  Since we only have .P, the
> .PP came out of nowhere.

Another good catch.  As you note, the domain is limited.  In documents
with long histories and multiple contributors, the pointless profusion
of paragraphing macros with identical semantics is sadly common.

> And then there's the extensive use of \f (without brackets)

Still _really_ common in the global man page corpus.  But yeah, a hard
mistake to make for someone who's a total n00b to man page writing in
general _and_ to the Linux man-pages project.  People don't think up
that syntax, they crib it from somewhere.  Or an LLM does it for them.

> and \(bu, of which we have no cases anymore.

Unlike `\f`, I regard `\(bu` [preferably spelled `\[bu]`] as cromulent
usage.  We need not be afraid of bullet characters.  They degrade to
US-ASCII perfectly well in groff (and mandoc(1) too) and I'm confident
that this special character will work everywhere the Linux man-pages are
likely to be formatted.  See groff_char(7).

> All of this was very suspicious, so I had to ask.

Is there a resource that collects "here's how I caught an LLM-generated
software patch/research paper/court filing" stories?

Regards,
Branden

[1] https://en.wikipedia.org/wiki/Object_permanence

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] man7, man2: document SCHED_EXT policy
  2026-04-22 17:23         ` G. Branden Robinson
@ 2026-04-22 18:08           ` Alejandro Colomar
  0 siblings, 0 replies; 10+ messages in thread
From: Alejandro Colomar @ 2026-04-22 18:08 UTC (permalink / raw)
  To: G. Branden Robinson; +Cc: linux-man

[-- Attachment #1: Type: text/plain, Size: 3796 bytes --]

Hi Branden,

On 2026-04-22T12:23:28-0500, G. Branden Robinson wrote:
[...]
> > However, 2 lines below there the patch introduced a line using BR
> > perfectly.  That very much read like random LLM stuff.
> 
> Nice catch.  I like the way you sussed that out.  While humans are not
> immune from this class of error (forgetting something you "knew" 60
> seconds ago--maybe more like 60 nanoseconds in LLM time), it's uncommon
> among mentally healthy people who haven't been hitting the "substances".
> 
> I'm reminded of how toddlers acquire object permanence.[1]  Not _quite_
> the same thing, as abstract knowledge is more easily lost ("what are the
> conventional units of the ideal gas constant?  how many operator
> precedence levels does C have, again?

Off-topic, but in case you have the doubt, it can be settled:

There are as many levels as subclauses under 6.5 ("Expressions")
--I don't know the number of subclauses from the top of my head, though,
of course--, excluding of course 6.5.1 ("General").

In C23 (n3220), that is documented in footnote 82:

	The syntax specifies the precedence of operators
	in the evaluation of an expression,
	which is the same as the order of
	the major subclauses of this subclause,
	highest precedence first.
	[...]

Checking the number of subclauses, it happened to be 17 (18 - 1) in C23,
and remains the same number in C2y.  That number seems to have stayed
stable: we already had 17 categories in C89 (but "Expressions" was then
3.3).

:)

> ")--but it seems close.
> 
> A course for people red-teaming LLMs to pursue, maybe.
> 
> > There was also the arbitrary combined use of .P and .PP.  I suspect no
> > human would use both in a document, unless the surrounding style
> > already uses both (which could confuse).  Since we only have .P, the
> > .PP came out of nowhere.
> 
> Another good catch.  As you note, the domain is limited.  In documents
> with long histories and multiple contributors, the pointless profusion
> of paragraphing macros with identical semantics is sadly common.
> 
> > And then there's the extensive use of \f (without brackets)
> 
> Still _really_ common in the global man page corpus.  But yeah, a hard
> mistake to make for someone who's a total n00b to man page writing in
> general _and_ to the Linux man-pages project.  People don't think up
> that syntax, they crib it from somewhere.  Or an LLM does it for them.
> 
> > and \(bu, of which we have no cases anymore.
> 
> Unlike `\f`, I regard `\(bu` [preferably spelled `\[bu]`] as cromulent
> usage.  We need not be afraid of bullet characters.  They degrade to
> US-ASCII perfectly well in groff (and mandoc(1) too) and I'm confident
> that this special character will work everywhere the Linux man-pages are
> likely to be formatted.  See groff_char(7).

Here we exclusively use the spelling \f[] and \[bu].  That's why \(bu
was suspicious.  I could expect it from an expert in the matter who
didn't know our style, but the author didn't seem one.

> 
> > All of this was very suspicious, so I had to ask.
> 
> Is there a resource that collects "here's how I caught an LLM-generated
> software patch/research paper/court filing" stories?

I haven't heard of any, but I suspect there is.  I've seen some good
amount of LLM crap that I think I have a good eye for catching it (even
if sometimes I may not say it explicitly, especially when the author
knows it's not allowed --I may prefer to wait for the author to disclose
it voluntarily; that has the benefit of allowing me to evaluate the
limits of the honesty of the human--).


Cheers,
Alex

> Regards,
> Branden
> 
> [1] https://en.wikipedia.org/wiki/Object_permanence

-- 
<https://www.alejandro-colomar.es>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-04-22 18:08 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-12 18:16 [PATCH] man7, man2: document SCHED_EXT policy Cheng-Yang Chou
2026-04-22 16:02 ` Alejandro Colomar
2026-04-22 16:13   ` Cheng-Yang Chou
2026-04-22 16:36     ` G. Branden Robinson
2026-04-22 16:59       ` Alejandro Colomar
2026-04-22 17:23         ` G. Branden Robinson
2026-04-22 18:08           ` Alejandro Colomar
2026-04-22 16:46   ` Cheng-Yang Chou
2026-04-22 17:04     ` Alejandro Colomar
2026-04-22 17:04     ` G. Branden Robinson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox