All of lore.kernel.org
 help / color / mirror / Atom feed
* [rcu:rcu/test 136/143] kernel/rcu/tree_plugin.h:2696:25: error: 'struct task_struct' has no member named 'on_cpu'
@ 2020-12-23 15:28 ` kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2020-12-23 15:28 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: kbuild-all, linux-kernel

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git rcu/test
head:   4c4c8e04a7f8522de634aa062f4cd6b8b80c151b
commit: 72351a864d02b480a5c237144033e21be816f29f [136/143] fixup! rcu/nocb: Add grace period and task state to show_rcu_nocb_state() output
config: nds32-randconfig-r014-20201221 (attached as .config)
compiler: nds32le-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git/commit/?id=72351a864d02b480a5c237144033e21be816f29f
        git remote add rcu https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
        git fetch --no-tags rcu rcu/test
        git checkout 72351a864d02b480a5c237144033e21be816f29f
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=nds32 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   In file included from include/linux/kernel.h:16,
                    from kernel/rcu/tree.c:21:
   kernel/rcu/tree_plugin.h: In function 'show_rcu_nocb_gp_state':
>> kernel/rcu/tree_plugin.h:2696:25: error: 'struct task_struct' has no member named 'on_cpu'
    2696 |    !rdp->nocb_cb_kthread->on_cpu ? "!" : "");
         |                         ^~
   include/linux/printk.h:373:34: note: in definition of macro 'pr_info'
     373 |  printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
         |                                  ^~~~~~~~~~~
   kernel/rcu/tree_plugin.h: In function 'show_rcu_nocb_state':
   kernel/rcu/tree_plugin.h:2737:25: error: 'struct task_struct' has no member named 'on_cpu'
    2737 |    !rdp->nocb_cb_kthread->on_cpu ? "!" : "");
         |                         ^~
   include/linux/printk.h:373:34: note: in definition of macro 'pr_info'
     373 |  printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
         |                                  ^~~~~~~~~~~


vim +2696 kernel/rcu/tree_plugin.h

  2669	
  2670	/*
  2671	 * Dump out nocb grace-period kthread state for the specified rcu_data
  2672	 * structure.
  2673	 */
  2674	static void show_rcu_nocb_gp_state(struct rcu_data *rdp)
  2675	{
  2676		struct rcu_node *rnp = rdp->mynode;
  2677	
  2678		pr_info("nocb GP %d %c%c%c%c%c%c %c[%c%c] %c%c:%ld rnp %d:%d %lu %c CPU %d%s\n",
  2679			rdp->cpu,
  2680			"kK"[!!rdp->nocb_gp_kthread],
  2681			"lL"[raw_spin_is_locked(&rdp->nocb_gp_lock)],
  2682			"dD"[!!rdp->nocb_defer_wakeup],
  2683			"tT"[timer_pending(&rdp->nocb_timer)],
  2684			"bB"[timer_pending(&rdp->nocb_bypass_timer)],
  2685			"sS"[!!rdp->nocb_gp_sleep],
  2686			".W"[swait_active(&rdp->nocb_gp_wq)],
  2687			".W"[swait_active(&rnp->nocb_gp_wq[0])],
  2688			".W"[swait_active(&rnp->nocb_gp_wq[1])],
  2689			".B"[!!rdp->nocb_gp_bypass],
  2690			".G"[!!rdp->nocb_gp_gp],
  2691			(long)rdp->nocb_gp_seq,
  2692			rnp->grplo, rnp->grphi, READ_ONCE(rdp->nocb_gp_loops),
  2693			rdp->nocb_gp_kthread ? task_state_to_char(rdp->nocb_gp_kthread) : '.',
  2694			rdp->nocb_cb_kthread ? (int)task_cpu(rdp->nocb_gp_kthread) : -1,
  2695			rdp->nocb_cb_kthread && rdp->nocb_cb_kthread->state == TASK_RUNNING &&
> 2696				!rdp->nocb_cb_kthread->on_cpu ? "!" : "");
  2697	}
  2698	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 22858 bytes --]

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

* [rcu:rcu/test 136/143] kernel/rcu/tree_plugin.h:2696:25: error: 'struct task_struct' has no member named 'on_cpu'
@ 2020-12-23 15:28 ` kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2020-12-23 15:28 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git rcu/test
head:   4c4c8e04a7f8522de634aa062f4cd6b8b80c151b
commit: 72351a864d02b480a5c237144033e21be816f29f [136/143] fixup! rcu/nocb: Add grace period and task state to show_rcu_nocb_state() output
config: nds32-randconfig-r014-20201221 (attached as .config)
compiler: nds32le-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git/commit/?id=72351a864d02b480a5c237144033e21be816f29f
        git remote add rcu https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
        git fetch --no-tags rcu rcu/test
        git checkout 72351a864d02b480a5c237144033e21be816f29f
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=nds32 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   In file included from include/linux/kernel.h:16,
                    from kernel/rcu/tree.c:21:
   kernel/rcu/tree_plugin.h: In function 'show_rcu_nocb_gp_state':
>> kernel/rcu/tree_plugin.h:2696:25: error: 'struct task_struct' has no member named 'on_cpu'
    2696 |    !rdp->nocb_cb_kthread->on_cpu ? "!" : "");
         |                         ^~
   include/linux/printk.h:373:34: note: in definition of macro 'pr_info'
     373 |  printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
         |                                  ^~~~~~~~~~~
   kernel/rcu/tree_plugin.h: In function 'show_rcu_nocb_state':
   kernel/rcu/tree_plugin.h:2737:25: error: 'struct task_struct' has no member named 'on_cpu'
    2737 |    !rdp->nocb_cb_kthread->on_cpu ? "!" : "");
         |                         ^~
   include/linux/printk.h:373:34: note: in definition of macro 'pr_info'
     373 |  printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
         |                                  ^~~~~~~~~~~


vim +2696 kernel/rcu/tree_plugin.h

  2669	
  2670	/*
  2671	 * Dump out nocb grace-period kthread state for the specified rcu_data
  2672	 * structure.
  2673	 */
  2674	static void show_rcu_nocb_gp_state(struct rcu_data *rdp)
  2675	{
  2676		struct rcu_node *rnp = rdp->mynode;
  2677	
  2678		pr_info("nocb GP %d %c%c%c%c%c%c %c[%c%c] %c%c:%ld rnp %d:%d %lu %c CPU %d%s\n",
  2679			rdp->cpu,
  2680			"kK"[!!rdp->nocb_gp_kthread],
  2681			"lL"[raw_spin_is_locked(&rdp->nocb_gp_lock)],
  2682			"dD"[!!rdp->nocb_defer_wakeup],
  2683			"tT"[timer_pending(&rdp->nocb_timer)],
  2684			"bB"[timer_pending(&rdp->nocb_bypass_timer)],
  2685			"sS"[!!rdp->nocb_gp_sleep],
  2686			".W"[swait_active(&rdp->nocb_gp_wq)],
  2687			".W"[swait_active(&rnp->nocb_gp_wq[0])],
  2688			".W"[swait_active(&rnp->nocb_gp_wq[1])],
  2689			".B"[!!rdp->nocb_gp_bypass],
  2690			".G"[!!rdp->nocb_gp_gp],
  2691			(long)rdp->nocb_gp_seq,
  2692			rnp->grplo, rnp->grphi, READ_ONCE(rdp->nocb_gp_loops),
  2693			rdp->nocb_gp_kthread ? task_state_to_char(rdp->nocb_gp_kthread) : '.',
  2694			rdp->nocb_cb_kthread ? (int)task_cpu(rdp->nocb_gp_kthread) : -1,
  2695			rdp->nocb_cb_kthread && rdp->nocb_cb_kthread->state == TASK_RUNNING &&
> 2696				!rdp->nocb_cb_kthread->on_cpu ? "!" : "");
  2697	}
  2698	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 22858 bytes --]

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

* Re: [rcu:rcu/test 136/143] kernel/rcu/tree_plugin.h:2696:25: error: 'struct task_struct' has no member named 'on_cpu'
  2020-12-23 15:28 ` kernel test robot
@ 2020-12-23 18:33   ` Paul E. McKenney
  -1 siblings, 0 replies; 4+ messages in thread
From: Paul E. McKenney @ 2020-12-23 18:33 UTC (permalink / raw)
  To: kernel test robot; +Cc: kbuild-all, linux-kernel

On Wed, Dec 23, 2020 at 11:28:58PM +0800, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git rcu/test
> head:   4c4c8e04a7f8522de634aa062f4cd6b8b80c151b
> commit: 72351a864d02b480a5c237144033e21be816f29f [136/143] fixup! rcu/nocb: Add grace period and task state to show_rcu_nocb_state() output
> config: nds32-randconfig-r014-20201221 (attached as .config)
> compiler: nds32le-linux-gcc (GCC) 9.3.0
> reproduce (this is a W=1 build):
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git/commit/?id=72351a864d02b480a5c237144033e21be816f29f
>         git remote add rcu https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
>         git fetch --no-tags rcu rcu/test
>         git checkout 72351a864d02b480a5c237144033e21be816f29f
>         # save the attached .config to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=nds32 
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> 
> All errors (new ones prefixed by >>):
> 
>    In file included from include/linux/kernel.h:16,
>                     from kernel/rcu/tree.c:21:
>    kernel/rcu/tree_plugin.h: In function 'show_rcu_nocb_gp_state':
> >> kernel/rcu/tree_plugin.h:2696:25: error: 'struct task_struct' has no member named 'on_cpu'
>     2696 |    !rdp->nocb_cb_kthread->on_cpu ? "!" : "");
>          |                         ^~
>    include/linux/printk.h:373:34: note: in definition of macro 'pr_info'
>      373 |  printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
>          |                                  ^~~~~~~~~~~
>    kernel/rcu/tree_plugin.h: In function 'show_rcu_nocb_state':
>    kernel/rcu/tree_plugin.h:2737:25: error: 'struct task_struct' has no member named 'on_cpu'
>     2737 |    !rdp->nocb_cb_kthread->on_cpu ? "!" : "");
>          |                         ^~
>    include/linux/printk.h:373:34: note: in definition of macro 'pr_info'
>      373 |  printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
>          |                                  ^~~~~~~~~~~

Good catch, I missed the case of !SMP and rcu_nocbs CPUs, thank you!

Does the following fix this for you?  (To be folded into the original
with attribution.)

							Thanx, Paul

------------------------------------------------------------------------

diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index 2c16fa8..f97c991 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -2668,6 +2668,19 @@ void rcu_bind_current_to_nocb(void)
 }
 EXPORT_SYMBOL_GPL(rcu_bind_current_to_nocb);
 
+// The ->on_cpu field is available only in CONFIG_SMP=y, so...
+#ifdef CONFIG_SMP
+static char *show_rcu_should_be_on_cpu(struct task_struct *tsp)
+{
+	return tsp && tsp->state == TASK_RUNNING && !tsp->on_cpu ? "!" : "";
+}
+#else // #ifdef CONFIG_SMP
+static char *show_rcu_should_be_on_cpu(struct task_struct *tsp)
+{
+	return "";
+}
+#endif // #else #ifdef CONFIG_SMP
+
 /*
  * Dump out nocb grace-period kthread state for the specified rcu_data
  * structure.
@@ -2693,8 +2706,7 @@ static void show_rcu_nocb_gp_state(struct rcu_data *rdp)
 		rnp->grplo, rnp->grphi, READ_ONCE(rdp->nocb_gp_loops),
 		rdp->nocb_gp_kthread ? task_state_to_char(rdp->nocb_gp_kthread) : '.',
 		rdp->nocb_cb_kthread ? (int)task_cpu(rdp->nocb_gp_kthread) : -1,
-		rdp->nocb_cb_kthread && rdp->nocb_cb_kthread->state == TASK_RUNNING &&
-			!rdp->nocb_cb_kthread->on_cpu ? "!" : "");
+		show_rcu_should_be_on_cpu(rdp->nocb_cb_kthread));
 }
 
 /* Dump out nocb kthread state for the specified rcu_data structure. */
@@ -2734,8 +2746,7 @@ static void show_rcu_nocb_state(struct rcu_data *rdp)
 		rcu_segcblist_n_cbs(&rdp->cblist),
 		rdp->nocb_cb_kthread ? task_state_to_char(rdp->nocb_cb_kthread) : '.',
 		rdp->nocb_cb_kthread ? (int)task_cpu(rdp->nocb_gp_kthread) : -1,
-		rdp->nocb_cb_kthread && rdp->nocb_cb_kthread->state == TASK_RUNNING &&
-			!rdp->nocb_cb_kthread->on_cpu ? "!" : "");
+		show_rcu_should_be_on_cpu(rdp->nocb_cb_kthread));
 
 	/* It is OK for GP kthreads to have GP state. */
 	if (rdp->nocb_gp_rdp == rdp)

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

* Re: [rcu:rcu/test 136/143] kernel/rcu/tree_plugin.h:2696:25: error: 'struct task_struct' has no member named 'on_cpu'
@ 2020-12-23 18:33   ` Paul E. McKenney
  0 siblings, 0 replies; 4+ messages in thread
From: Paul E. McKenney @ 2020-12-23 18:33 UTC (permalink / raw)
  To: kbuild-all

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

On Wed, Dec 23, 2020 at 11:28:58PM +0800, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git rcu/test
> head:   4c4c8e04a7f8522de634aa062f4cd6b8b80c151b
> commit: 72351a864d02b480a5c237144033e21be816f29f [136/143] fixup! rcu/nocb: Add grace period and task state to show_rcu_nocb_state() output
> config: nds32-randconfig-r014-20201221 (attached as .config)
> compiler: nds32le-linux-gcc (GCC) 9.3.0
> reproduce (this is a W=1 build):
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git/commit/?id=72351a864d02b480a5c237144033e21be816f29f
>         git remote add rcu https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
>         git fetch --no-tags rcu rcu/test
>         git checkout 72351a864d02b480a5c237144033e21be816f29f
>         # save the attached .config to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=nds32 
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> 
> All errors (new ones prefixed by >>):
> 
>    In file included from include/linux/kernel.h:16,
>                     from kernel/rcu/tree.c:21:
>    kernel/rcu/tree_plugin.h: In function 'show_rcu_nocb_gp_state':
> >> kernel/rcu/tree_plugin.h:2696:25: error: 'struct task_struct' has no member named 'on_cpu'
>     2696 |    !rdp->nocb_cb_kthread->on_cpu ? "!" : "");
>          |                         ^~
>    include/linux/printk.h:373:34: note: in definition of macro 'pr_info'
>      373 |  printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
>          |                                  ^~~~~~~~~~~
>    kernel/rcu/tree_plugin.h: In function 'show_rcu_nocb_state':
>    kernel/rcu/tree_plugin.h:2737:25: error: 'struct task_struct' has no member named 'on_cpu'
>     2737 |    !rdp->nocb_cb_kthread->on_cpu ? "!" : "");
>          |                         ^~
>    include/linux/printk.h:373:34: note: in definition of macro 'pr_info'
>      373 |  printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
>          |                                  ^~~~~~~~~~~

Good catch, I missed the case of !SMP and rcu_nocbs CPUs, thank you!

Does the following fix this for you?  (To be folded into the original
with attribution.)

							Thanx, Paul

------------------------------------------------------------------------

diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index 2c16fa8..f97c991 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -2668,6 +2668,19 @@ void rcu_bind_current_to_nocb(void)
 }
 EXPORT_SYMBOL_GPL(rcu_bind_current_to_nocb);
 
+// The ->on_cpu field is available only in CONFIG_SMP=y, so...
+#ifdef CONFIG_SMP
+static char *show_rcu_should_be_on_cpu(struct task_struct *tsp)
+{
+	return tsp && tsp->state == TASK_RUNNING && !tsp->on_cpu ? "!" : "";
+}
+#else // #ifdef CONFIG_SMP
+static char *show_rcu_should_be_on_cpu(struct task_struct *tsp)
+{
+	return "";
+}
+#endif // #else #ifdef CONFIG_SMP
+
 /*
  * Dump out nocb grace-period kthread state for the specified rcu_data
  * structure.
@@ -2693,8 +2706,7 @@ static void show_rcu_nocb_gp_state(struct rcu_data *rdp)
 		rnp->grplo, rnp->grphi, READ_ONCE(rdp->nocb_gp_loops),
 		rdp->nocb_gp_kthread ? task_state_to_char(rdp->nocb_gp_kthread) : '.',
 		rdp->nocb_cb_kthread ? (int)task_cpu(rdp->nocb_gp_kthread) : -1,
-		rdp->nocb_cb_kthread && rdp->nocb_cb_kthread->state == TASK_RUNNING &&
-			!rdp->nocb_cb_kthread->on_cpu ? "!" : "");
+		show_rcu_should_be_on_cpu(rdp->nocb_cb_kthread));
 }
 
 /* Dump out nocb kthread state for the specified rcu_data structure. */
@@ -2734,8 +2746,7 @@ static void show_rcu_nocb_state(struct rcu_data *rdp)
 		rcu_segcblist_n_cbs(&rdp->cblist),
 		rdp->nocb_cb_kthread ? task_state_to_char(rdp->nocb_cb_kthread) : '.',
 		rdp->nocb_cb_kthread ? (int)task_cpu(rdp->nocb_gp_kthread) : -1,
-		rdp->nocb_cb_kthread && rdp->nocb_cb_kthread->state == TASK_RUNNING &&
-			!rdp->nocb_cb_kthread->on_cpu ? "!" : "");
+		show_rcu_should_be_on_cpu(rdp->nocb_cb_kthread));
 
 	/* It is OK for GP kthreads to have GP state. */
 	if (rdp->nocb_gp_rdp == rdp)

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

end of thread, other threads:[~2020-12-23 18:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-23 15:28 [rcu:rcu/test 136/143] kernel/rcu/tree_plugin.h:2696:25: error: 'struct task_struct' has no member named 'on_cpu' kernel test robot
2020-12-23 15:28 ` kernel test robot
2020-12-23 18:33 ` Paul E. McKenney
2020-12-23 18:33   ` Paul E. McKenney

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.