diff mbox series

[v2,2/4] sched/isolation: Improve documentation

Message ID 20221013184028.129486-3-leobras@redhat.com (mailing list archive)
State Not Applicable
Delegated to: Netdev Maintainers
Headers show
Series CPU isolation improvements | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Leonardo Bras Oct. 13, 2022, 6:40 p.m. UTC
Improve documentation on housekeeping types and what to expect from
housekeeping functions.

Signed-off-by: Leonardo Bras <leobras@redhat.com>
---
 include/linux/sched/isolation.h | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

Comments

Peter Zijlstra Oct. 14, 2022, 8:32 a.m. UTC | #1
On Thu, Oct 13, 2022 at 03:40:27PM -0300, Leonardo Bras wrote:

> +/* Kernel parameters like nohz_full and isolcpus allow passing cpu numbers
> + * for disabling housekeeping types.
> + *
> + * The functions bellow work the opposite way, by referencing which cpus
> + * are able to perform the housekeeping type in parameter.
> + */

So checkpatch should have bitten your head off for this drug-indiced
comment style :-)

https://lore.kernel.org/all/CA+55aFyQYJerovMsSoSKS7PessZBr4vNp-3QUUwhqk4A4_jcbg@mail.gmail.com/
Leonardo Bras Oct. 14, 2022, 3:40 p.m. UTC | #2
On Fri, Oct 14, 2022 at 6:03 AM Peter Zijlstra <peterz@infradead.org> wrote:
>
> On Thu, Oct 13, 2022 at 03:40:27PM -0300, Leonardo Bras wrote:
>
> > +/* Kernel parameters like nohz_full and isolcpus allow passing cpu numbers
> > + * for disabling housekeeping types.
> > + *
> > + * The functions bellow work the opposite way, by referencing which cpus
> > + * are able to perform the housekeeping type in parameter.
> > + */
>
> So checkpatch should have bitten your head off for this drug-indiced
> comment style :-)

Oh, my bad on this one, I will fix that now.

>
> https://lore.kernel.org/all/CA+55aFyQYJerovMsSoSKS7PessZBr4vNp-3QUUwhqk4A4_jcbg@mail.gmail.com/
>

Any comments in the text? Is that correct?

Thanks for the feedback!

Best regards,
Leo
Frederic Weisbecker Nov. 29, 2022, 11:54 a.m. UTC | #3
On Thu, Oct 13, 2022 at 03:40:27PM -0300, Leonardo Bras wrote:
> Improve documentation on housekeeping types and what to expect from
> housekeeping functions.
> 
> Signed-off-by: Leonardo Bras <leobras@redhat.com>
> ---
>  include/linux/sched/isolation.h | 25 ++++++++++++++++---------
>  1 file changed, 16 insertions(+), 9 deletions(-)
> 
> diff --git a/include/linux/sched/isolation.h b/include/linux/sched/isolation.h
> index 762701f295d1c..9333c28153a7a 100644
> --- a/include/linux/sched/isolation.h
> +++ b/include/linux/sched/isolation.h
> @@ -7,18 +7,25 @@
>  #include <linux/tick.h>
>  
>  enum hk_type {
> -	HK_TYPE_TIMER,
> -	HK_TYPE_RCU,
> -	HK_TYPE_MISC,
> -	HK_TYPE_SCHED,
> -	HK_TYPE_TICK,
> -	HK_TYPE_DOMAIN,
> -	HK_TYPE_WQ,
> -	HK_TYPE_MANAGED_IRQ,
> -	HK_TYPE_KTHREAD,
> +	HK_TYPE_TIMER,		/* Timer interrupt, watchdogs */

More precisely:

     /* Unbound timer callbacks */

> +	HK_TYPE_RCU,		/* RCU callbacks */

More generally, because it's more than just about callbacks:

     /* Unbound RCU work */

> +	HK_TYPE_MISC,		/* Minor housekeeping categories */
> +	HK_TYPE_SCHED,		/* Scheduling and idle load balancing */
> +	HK_TYPE_TICK,		/* See isolcpus=nohz boot parameter */

Yes or nohz_full=

> +	HK_TYPE_DOMAIN,		/* See isolcpus=domain boot parameter*/
> +	HK_TYPE_WQ,		/* Work Queues*/

  /* Unbound workqueues */

> +	HK_TYPE_MANAGED_IRQ,	/* See isolcpus=managed_irq boot parameter */
> +	HK_TYPE_KTHREAD,	/* kernel threads */

  /* Unbound kernel threads */


>  	HK_TYPE_MAX
>  };
>  
> +/* Kernel parameters like nohz_full and isolcpus allow passing cpu numbers
> + * for disabling housekeeping types.
> + *
> + * The functions bellow work the opposite way, by referencing which cpus
> + * are able to perform the housekeeping type in parameter.
> + */

*below

Thanks!

> +
>  #ifdef CONFIG_CPU_ISOLATION
>  DECLARE_STATIC_KEY_FALSE(housekeeping_overridden);
>  int housekeeping_any_cpu(enum hk_type type);
> -- 
> 2.38.0
>
Leonardo Bras Dec. 17, 2022, 5:04 a.m. UTC | #4
On Tue, 2022-11-29 at 12:54 +0100, Frederic Weisbecker wrote:
> On Thu, Oct 13, 2022 at 03:40:27PM -0300, Leonardo Bras wrote:
> > Improve documentation on housekeeping types and what to expect from
> > housekeeping functions.
> > 
> > Signed-off-by: Leonardo Bras <leobras@redhat.com>
> > ---
> >  include/linux/sched/isolation.h | 25 ++++++++++++++++---------
> >  1 file changed, 16 insertions(+), 9 deletions(-)
> > 
> > diff --git a/include/linux/sched/isolation.h b/include/linux/sched/isolation.h
> > index 762701f295d1c..9333c28153a7a 100644
> > --- a/include/linux/sched/isolation.h
> > +++ b/include/linux/sched/isolation.h
> > @@ -7,18 +7,25 @@
> >  #include <linux/tick.h>
> >  
> >  enum hk_type {
> > -	HK_TYPE_TIMER,
> > -	HK_TYPE_RCU,
> > -	HK_TYPE_MISC,
> > -	HK_TYPE_SCHED,
> > -	HK_TYPE_TICK,
> > -	HK_TYPE_DOMAIN,
> > -	HK_TYPE_WQ,
> > -	HK_TYPE_MANAGED_IRQ,
> > -	HK_TYPE_KTHREAD,
> > +	HK_TYPE_TIMER,		/* Timer interrupt, watchdogs */
> 
> More precisely:
> 
>      /* Unbound timer callbacks */
> 
> > +	HK_TYPE_RCU,		/* RCU callbacks */
> 
> More generally, because it's more than just about callbacks:
> 
>      /* Unbound RCU work */

Both updated, thanks!

Out of curiosity, what does 'Unbound' means in this context?

> 
> > +	HK_TYPE_MISC,		/* Minor housekeeping categories */
> > +	HK_TYPE_SCHED,		/* Scheduling and idle load balancing */
> > +	HK_TYPE_TICK,		/* See isolcpus=nohz boot parameter */
> 
> Yes or nohz_full=
> 
> > +	HK_TYPE_DOMAIN,		/* See isolcpus=domain boot parameter*/
> > +	HK_TYPE_WQ,		/* Work Queues*/
> 
>   /* Unbound workqueues */
> 
> > +	HK_TYPE_MANAGED_IRQ,	/* See isolcpus=managed_irq boot parameter */
> > +	HK_TYPE_KTHREAD,	/* kernel threads */
> 
>   /* Unbound kernel threads */
> 
> 
> >  	HK_TYPE_MAX
> >  };
> >  
> > +/* Kernel parameters like nohz_full and isolcpus allow passing cpu numbers
> > + * for disabling housekeeping types.
> > + *
> > + * The functions bellow work the opposite way, by referencing which cpus
> > + * are able to perform the housekeeping type in parameter.
> > + */
> 
> *below
> 
> Thanks!

Done, done, done, done.
Thanks a lot for reviewing!

Best regards,
Leo

> 
> > +
> >  #ifdef CONFIG_CPU_ISOLATION
> >  DECLARE_STATIC_KEY_FALSE(housekeeping_overridden);
> >  int housekeeping_any_cpu(enum hk_type type);
> > -- 
> > 2.38.0
> > 
>
diff mbox series

Patch

diff --git a/include/linux/sched/isolation.h b/include/linux/sched/isolation.h
index 762701f295d1c..9333c28153a7a 100644
--- a/include/linux/sched/isolation.h
+++ b/include/linux/sched/isolation.h
@@ -7,18 +7,25 @@ 
 #include <linux/tick.h>
 
 enum hk_type {
-	HK_TYPE_TIMER,
-	HK_TYPE_RCU,
-	HK_TYPE_MISC,
-	HK_TYPE_SCHED,
-	HK_TYPE_TICK,
-	HK_TYPE_DOMAIN,
-	HK_TYPE_WQ,
-	HK_TYPE_MANAGED_IRQ,
-	HK_TYPE_KTHREAD,
+	HK_TYPE_TIMER,		/* Timer interrupt, watchdogs */
+	HK_TYPE_RCU,		/* RCU callbacks */
+	HK_TYPE_MISC,		/* Minor housekeeping categories */
+	HK_TYPE_SCHED,		/* Scheduling and idle load balancing */
+	HK_TYPE_TICK,		/* See isolcpus=nohz boot parameter */
+	HK_TYPE_DOMAIN,		/* See isolcpus=domain boot parameter*/
+	HK_TYPE_WQ,		/* Work Queues*/
+	HK_TYPE_MANAGED_IRQ,	/* See isolcpus=managed_irq boot parameter */
+	HK_TYPE_KTHREAD,	/* kernel threads */
 	HK_TYPE_MAX
 };
 
+/* Kernel parameters like nohz_full and isolcpus allow passing cpu numbers
+ * for disabling housekeeping types.
+ *
+ * The functions bellow work the opposite way, by referencing which cpus
+ * are able to perform the housekeeping type in parameter.
+ */
+
 #ifdef CONFIG_CPU_ISOLATION
 DECLARE_STATIC_KEY_FALSE(housekeeping_overridden);
 int housekeeping_any_cpu(enum hk_type type);