public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [paulmck-rcu:dev.2024.08.30a 27/33] include/linux/srcu.h:246:37: error: 'SRCU_READ_FLAVOR_NORMAL' undeclared
@ 2024-08-31  5:51 kernel test robot
  2024-08-31 13:29 ` Paul E. McKenney
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2024-08-31  5:51 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: oe-kbuild-all, linux-kernel

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git dev.2024.08.30a
head:   05416eb79213ad6a9770faa795059fdd00adb6e0
commit: d4401cc54f3e2985675be825f5222aff9764ab8b [27/33] srcu: Convert srcu_data ->srcu_reader_flavor to bit field
config: m68k-randconfig-r072-20240831 (https://download.01.org/0day-ci/archive/20240831/202408311318.wcMCNEWH-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 14.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240831/202408311318.wcMCNEWH-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202408311318.wcMCNEWH-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from include/linux/notifier.h:16,
                    from include/linux/memory_hotplug.h:7,
                    from include/linux/mmzone.h:1432,
                    from include/linux/topology.h:33,
                    from include/linux/irq.h:19,
                    from include/asm-generic/hardirq.h:17,
                    from ./arch/m68k/include/generated/asm/hardirq.h:1,
                    from include/linux/hardirq.h:11,
                    from include/linux/interrupt.h:11,
                    from include/linux/kernel_stat.h:8,
                    from arch/m68k/kernel/asm-offsets.c:16:
   include/linux/srcu.h: In function 'srcu_read_lock':
>> include/linux/srcu.h:246:37: error: 'SRCU_READ_FLAVOR_NORMAL' undeclared (first use in this function)
     246 |         srcu_check_read_flavor(ssp, SRCU_READ_FLAVOR_NORMAL);
         |                                     ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/srcu.h:246:37: note: each undeclared identifier is reported only once for each function it appears in
   include/linux/srcu.h: In function 'srcu_read_lock_nmisafe':
>> include/linux/srcu.h:267:37: error: 'SRCU_READ_FLAVOR_NMI' undeclared (first use in this function)
     267 |         srcu_check_read_flavor(ssp, SRCU_READ_FLAVOR_NMI);
         |                                     ^~~~~~~~~~~~~~~~~~~~
   include/linux/srcu.h: In function 'srcu_read_lock_notrace':
   include/linux/srcu.h:279:37: error: 'SRCU_READ_FLAVOR_NORMAL' undeclared (first use in this function)
     279 |         srcu_check_read_flavor(ssp, SRCU_READ_FLAVOR_NORMAL);
         |                                     ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/srcu.h: In function 'srcu_down_read':
   include/linux/srcu.h:308:37: error: 'SRCU_READ_FLAVOR_NORMAL' undeclared (first use in this function)
     308 |         srcu_check_read_flavor(ssp, SRCU_READ_FLAVOR_NORMAL);
         |                                     ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/srcu.h: In function 'srcu_read_unlock':
   include/linux/srcu.h:323:37: error: 'SRCU_READ_FLAVOR_NORMAL' undeclared (first use in this function)
     323 |         srcu_check_read_flavor(ssp, SRCU_READ_FLAVOR_NORMAL);
         |                                     ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/srcu.h: In function 'srcu_read_unlock_nmisafe':
   include/linux/srcu.h:339:37: error: 'SRCU_READ_FLAVOR_NMI' undeclared (first use in this function)
     339 |         srcu_check_read_flavor(ssp, SRCU_READ_FLAVOR_NMI);
         |                                     ^~~~~~~~~~~~~~~~~~~~
   include/linux/srcu.h: In function 'srcu_read_unlock_notrace':
   include/linux/srcu.h:348:37: error: 'SRCU_READ_FLAVOR_NORMAL' undeclared (first use in this function)
     348 |         srcu_check_read_flavor(ssp, SRCU_READ_FLAVOR_NORMAL);
         |                                     ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/srcu.h: In function 'srcu_up_read':
   include/linux/srcu.h:365:37: error: 'SRCU_READ_FLAVOR_NORMAL' undeclared (first use in this function)
     365 |         srcu_check_read_flavor(ssp, SRCU_READ_FLAVOR_NORMAL);
         |                                     ^~~~~~~~~~~~~~~~~~~~~~~
   make[3]: *** [scripts/Makefile.build:117: arch/m68k/kernel/asm-offsets.s] Error 1
   make[3]: Target 'prepare' not remade because of errors.
   make[2]: *** [Makefile:1193: prepare0] Error 2
   make[2]: Target 'prepare' not remade because of errors.
   make[1]: *** [Makefile:224: __sub-make] Error 2
   make[1]: Target 'prepare' not remade because of errors.
   make: *** [Makefile:224: __sub-make] Error 2
   make: Target 'prepare' not remade because of errors.


vim +/SRCU_READ_FLAVOR_NORMAL +246 include/linux/srcu.h

   221	
   222	/**
   223	 * srcu_read_lock - register a new reader for an SRCU-protected structure.
   224	 * @ssp: srcu_struct in which to register the new reader.
   225	 *
   226	 * Enter an SRCU read-side critical section.  Note that SRCU read-side
   227	 * critical sections may be nested.  However, it is illegal to
   228	 * call anything that waits on an SRCU grace period for the same
   229	 * srcu_struct, whether directly or indirectly.  Please note that
   230	 * one way to indirectly wait on an SRCU grace period is to acquire
   231	 * a mutex that is held elsewhere while calling synchronize_srcu() or
   232	 * synchronize_srcu_expedited().
   233	 *
   234	 * The return value from srcu_read_lock() must be passed unaltered
   235	 * to the matching srcu_read_unlock().  Note that srcu_read_lock() and
   236	 * the matching srcu_read_unlock() must occur in the same context, for
   237	 * example, it is illegal to invoke srcu_read_unlock() in an irq handler
   238	 * if the matching srcu_read_lock() was invoked in process context.  Or,
   239	 * for that matter to invoke srcu_read_unlock() from one task and the
   240	 * matching srcu_read_lock() from another.
   241	 */
   242	static inline int srcu_read_lock(struct srcu_struct *ssp) __acquires(ssp)
   243	{
   244		int retval;
   245	
 > 246		srcu_check_read_flavor(ssp, SRCU_READ_FLAVOR_NORMAL);
   247		retval = __srcu_read_lock(ssp);
   248		srcu_lock_acquire(&ssp->dep_map);
   249		return retval;
   250	}
   251	
   252	/**
   253	 * srcu_read_lock_nmisafe - register a new reader for an SRCU-protected structure.
   254	 * @ssp: srcu_struct in which to register the new reader.
   255	 *
   256	 * Enter an SRCU read-side critical section, but in an NMI-safe manner.
   257	 * See srcu_read_lock() for more information.
   258	 *
   259	 * If srcu_read_lock_nmisafe() is ever used on an srcu_struct structure,
   260	 * then none of the other flavors may be used, whether before, during,
   261	 * or after.
   262	 */
   263	static inline int srcu_read_lock_nmisafe(struct srcu_struct *ssp) __acquires(ssp)
   264	{
   265		int retval;
   266	
 > 267		srcu_check_read_flavor(ssp, SRCU_READ_FLAVOR_NMI);
   268		retval = __srcu_read_lock_nmisafe(ssp);
   269		rcu_try_lock_acquire(&ssp->dep_map);
   270		return retval;
   271	}
   272	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

* Re: [paulmck-rcu:dev.2024.08.30a 27/33] include/linux/srcu.h:246:37: error: 'SRCU_READ_FLAVOR_NORMAL' undeclared
  2024-08-31  5:51 [paulmck-rcu:dev.2024.08.30a 27/33] include/linux/srcu.h:246:37: error: 'SRCU_READ_FLAVOR_NORMAL' undeclared kernel test robot
@ 2024-08-31 13:29 ` Paul E. McKenney
  0 siblings, 0 replies; 2+ messages in thread
From: Paul E. McKenney @ 2024-08-31 13:29 UTC (permalink / raw)
  To: kernel test robot; +Cc: oe-kbuild-all, linux-kernel

On Sat, Aug 31, 2024 at 01:51:05PM +0800, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git dev.2024.08.30a
> head:   05416eb79213ad6a9770faa795059fdd00adb6e0
> commit: d4401cc54f3e2985675be825f5222aff9764ab8b [27/33] srcu: Convert srcu_data ->srcu_reader_flavor to bit field
> config: m68k-randconfig-r072-20240831 (https://download.01.org/0day-ci/archive/20240831/202408311318.wcMCNEWH-lkp@intel.com/config)
> compiler: m68k-linux-gcc (GCC) 14.1.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240831/202408311318.wcMCNEWH-lkp@intel.com/reproduce)
> 
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202408311318.wcMCNEWH-lkp@intel.com/

Good catch, thank you!  Does this commit fix the issue for you?

e97f0db697ae ("fixup! srcu: Add srcu_read_lock_lite() and srcu_read_unlock_lite()"

Please see the end of this message for this in patch form.  I believe
that this will fix the other reports, as well.  (Famous last words!)

							Thanx, Paul

> All errors (new ones prefixed by >>):
> 
>    In file included from include/linux/notifier.h:16,
>                     from include/linux/memory_hotplug.h:7,
>                     from include/linux/mmzone.h:1432,
>                     from include/linux/topology.h:33,
>                     from include/linux/irq.h:19,
>                     from include/asm-generic/hardirq.h:17,
>                     from ./arch/m68k/include/generated/asm/hardirq.h:1,
>                     from include/linux/hardirq.h:11,
>                     from include/linux/interrupt.h:11,
>                     from include/linux/kernel_stat.h:8,
>                     from arch/m68k/kernel/asm-offsets.c:16:
>    include/linux/srcu.h: In function 'srcu_read_lock':
> >> include/linux/srcu.h:246:37: error: 'SRCU_READ_FLAVOR_NORMAL' undeclared (first use in this function)
>      246 |         srcu_check_read_flavor(ssp, SRCU_READ_FLAVOR_NORMAL);
>          |                                     ^~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/srcu.h:246:37: note: each undeclared identifier is reported only once for each function it appears in
>    include/linux/srcu.h: In function 'srcu_read_lock_nmisafe':
> >> include/linux/srcu.h:267:37: error: 'SRCU_READ_FLAVOR_NMI' undeclared (first use in this function)
>      267 |         srcu_check_read_flavor(ssp, SRCU_READ_FLAVOR_NMI);
>          |                                     ^~~~~~~~~~~~~~~~~~~~
>    include/linux/srcu.h: In function 'srcu_read_lock_notrace':
>    include/linux/srcu.h:279:37: error: 'SRCU_READ_FLAVOR_NORMAL' undeclared (first use in this function)
>      279 |         srcu_check_read_flavor(ssp, SRCU_READ_FLAVOR_NORMAL);
>          |                                     ^~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/srcu.h: In function 'srcu_down_read':
>    include/linux/srcu.h:308:37: error: 'SRCU_READ_FLAVOR_NORMAL' undeclared (first use in this function)
>      308 |         srcu_check_read_flavor(ssp, SRCU_READ_FLAVOR_NORMAL);
>          |                                     ^~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/srcu.h: In function 'srcu_read_unlock':
>    include/linux/srcu.h:323:37: error: 'SRCU_READ_FLAVOR_NORMAL' undeclared (first use in this function)
>      323 |         srcu_check_read_flavor(ssp, SRCU_READ_FLAVOR_NORMAL);
>          |                                     ^~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/srcu.h: In function 'srcu_read_unlock_nmisafe':
>    include/linux/srcu.h:339:37: error: 'SRCU_READ_FLAVOR_NMI' undeclared (first use in this function)
>      339 |         srcu_check_read_flavor(ssp, SRCU_READ_FLAVOR_NMI);
>          |                                     ^~~~~~~~~~~~~~~~~~~~
>    include/linux/srcu.h: In function 'srcu_read_unlock_notrace':
>    include/linux/srcu.h:348:37: error: 'SRCU_READ_FLAVOR_NORMAL' undeclared (first use in this function)
>      348 |         srcu_check_read_flavor(ssp, SRCU_READ_FLAVOR_NORMAL);
>          |                                     ^~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/srcu.h: In function 'srcu_up_read':
>    include/linux/srcu.h:365:37: error: 'SRCU_READ_FLAVOR_NORMAL' undeclared (first use in this function)
>      365 |         srcu_check_read_flavor(ssp, SRCU_READ_FLAVOR_NORMAL);
>          |                                     ^~~~~~~~~~~~~~~~~~~~~~~
>    make[3]: *** [scripts/Makefile.build:117: arch/m68k/kernel/asm-offsets.s] Error 1
>    make[3]: Target 'prepare' not remade because of errors.
>    make[2]: *** [Makefile:1193: prepare0] Error 2
>    make[2]: Target 'prepare' not remade because of errors.
>    make[1]: *** [Makefile:224: __sub-make] Error 2
>    make[1]: Target 'prepare' not remade because of errors.
>    make: *** [Makefile:224: __sub-make] Error 2
>    make: Target 'prepare' not remade because of errors.
> 
> 
> vim +/SRCU_READ_FLAVOR_NORMAL +246 include/linux/srcu.h
> 
>    221	
>    222	/**
>    223	 * srcu_read_lock - register a new reader for an SRCU-protected structure.
>    224	 * @ssp: srcu_struct in which to register the new reader.
>    225	 *
>    226	 * Enter an SRCU read-side critical section.  Note that SRCU read-side
>    227	 * critical sections may be nested.  However, it is illegal to
>    228	 * call anything that waits on an SRCU grace period for the same
>    229	 * srcu_struct, whether directly or indirectly.  Please note that
>    230	 * one way to indirectly wait on an SRCU grace period is to acquire
>    231	 * a mutex that is held elsewhere while calling synchronize_srcu() or
>    232	 * synchronize_srcu_expedited().
>    233	 *
>    234	 * The return value from srcu_read_lock() must be passed unaltered
>    235	 * to the matching srcu_read_unlock().  Note that srcu_read_lock() and
>    236	 * the matching srcu_read_unlock() must occur in the same context, for
>    237	 * example, it is illegal to invoke srcu_read_unlock() in an irq handler
>    238	 * if the matching srcu_read_lock() was invoked in process context.  Or,
>    239	 * for that matter to invoke srcu_read_unlock() from one task and the
>    240	 * matching srcu_read_lock() from another.
>    241	 */
>    242	static inline int srcu_read_lock(struct srcu_struct *ssp) __acquires(ssp)
>    243	{
>    244		int retval;
>    245	
>  > 246		srcu_check_read_flavor(ssp, SRCU_READ_FLAVOR_NORMAL);
>    247		retval = __srcu_read_lock(ssp);
>    248		srcu_lock_acquire(&ssp->dep_map);
>    249		return retval;
>    250	}
>    251	
>    252	/**
>    253	 * srcu_read_lock_nmisafe - register a new reader for an SRCU-protected structure.
>    254	 * @ssp: srcu_struct in which to register the new reader.
>    255	 *
>    256	 * Enter an SRCU read-side critical section, but in an NMI-safe manner.
>    257	 * See srcu_read_lock() for more information.
>    258	 *
>    259	 * If srcu_read_lock_nmisafe() is ever used on an srcu_struct structure,
>    260	 * then none of the other flavors may be used, whether before, during,
>    261	 * or after.
>    262	 */
>    263	static inline int srcu_read_lock_nmisafe(struct srcu_struct *ssp) __acquires(ssp)
>    264	{
>    265		int retval;
>    266	
>  > 267		srcu_check_read_flavor(ssp, SRCU_READ_FLAVOR_NMI);
>    268		retval = __srcu_read_lock_nmisafe(ssp);
>    269		rcu_try_lock_acquire(&ssp->dep_map);
>    270		return retval;
>    271	}
>    272	

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

commit e97f0db697aef503a9363137dcfa7f3dc66573ac
Author: Paul E. McKenney <paulmck@kernel.org>
Date:   Fri Aug 30 11:19:28 2024 -0700

    fixup! srcu: Add srcu_read_lock_lite() and srcu_read_unlock_lite()
    
    Signed-off-by: Paul E. McKenney <paulmck@kernel.org>

diff --git a/include/linux/srcu.h b/include/linux/srcu.h
index 718c1a17b70a3..4ba96e2cfa405 100644
--- a/include/linux/srcu.h
+++ b/include/linux/srcu.h
@@ -56,8 +56,13 @@ void call_srcu(struct srcu_struct *ssp, struct rcu_head *head,
 void cleanup_srcu_struct(struct srcu_struct *ssp);
 int __srcu_read_lock(struct srcu_struct *ssp) __acquires(ssp);
 void __srcu_read_unlock(struct srcu_struct *ssp, int idx) __releases(ssp);
+#ifdef CONFIG_TINY_SRCU
+#define __srcu_read_lock_lite __srcu_read_lock
+#define __srcu_read_unlock_lite __srcu_read_unlock
+#else // #ifdef CONFIG_TINY_SRCU
 int __srcu_read_lock_lite(struct srcu_struct *ssp) __acquires(ssp);
 void __srcu_read_unlock_lite(struct srcu_struct *ssp, int idx) __releases(ssp);
+#endif // #else // #ifdef CONFIG_TINY_SRCU
 void synchronize_srcu(struct srcu_struct *ssp);
 
 #define SRCU_GET_STATE_COMPLETED 0x1
@@ -181,7 +186,7 @@ static inline int srcu_read_lock_held(const struct srcu_struct *ssp)
 #if defined(CONFIG_PROVE_RCU) && defined(CONFIG_TREE_SRCU)
 void srcu_check_read_flavor(struct srcu_struct *ssp, int read_flavor);
 #else
-static inline void srcu_check_read_flavor(struct srcu_struct *ssp, int read_flavor) { }
+#define srcu_check_read_flavor(ssp, read_flavor) do { } while (0)
 #endif
 
 

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

end of thread, other threads:[~2024-08-31 13:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-31  5:51 [paulmck-rcu:dev.2024.08.30a 27/33] include/linux/srcu.h:246:37: error: 'SRCU_READ_FLAVOR_NORMAL' undeclared kernel test robot
2024-08-31 13:29 ` Paul E. McKenney

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