mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] srcutree: Skip torture to-big transition for atomic SRCU
@ 2026-09-10  4:14 Kunwu Chan
  2026-09-10 14:33 ` kernel test robot
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Kunwu Chan @ 2026-09-10  4:14 UTC (permalink / raw)
  To: jiangshanlai, paulmck, josh, rostedt, mathieu.desnoyers
  Cc: rcu, linux-kernel, Kunwu Chan

Atomic SRCU does not use the srcu_node combining tree.  Exclude it
from the SRCU_SIZING_IS_TORTURE() transition in
srcu_torture_stats_print().

Signed-off-by: Kunwu Chan <kunwu.chan@gmail.com>
---
 kernel/rcu/srcutree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c
index d462102c6bb6..99d11fb4123a 100644
--- a/kernel/rcu/srcutree.c
+++ b/kernel/rcu/srcutree.c
@@ -2421,7 +2421,7 @@ void srcu_torture_stats_print(struct srcu_struct *ssp, char *tt, char *tf)
 		}
 		pr_cont(" T(%ld,%ld)\n", s0, s1);
 	}
-	if (SRCU_SIZING_IS_TORTURE())
+	if (SRCU_SIZING_IS_TORTURE() && ssp->srcu_reader_flavor != SRCU_READ_FLAVOR_ATOMIC)
 		srcu_transition_to_big(ssp);
 }
 EXPORT_SYMBOL_GPL(srcu_torture_stats_print);
-- 
2.43.0


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

* Re: [PATCH] srcutree: Skip torture to-big transition for atomic SRCU
  2026-09-10  4:14 [PATCH] srcutree: Skip torture to-big transition for atomic SRCU Kunwu Chan
@ 2026-09-10 14:33 ` kernel test robot
  2026-09-10 14:34 ` kernel test robot
  2026-09-10 16:53 ` Paul E. McKenney
  2 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2026-09-10 14:33 UTC (permalink / raw)
  To: Kunwu Chan, jiangshanlai, paulmck, josh, rostedt, mathieu.desnoyers
  Cc: oe-kbuild-all, rcu, linux-kernel, Kunwu Chan

Hi Kunwu,

kernel test robot noticed the following build errors:

[auto build test ERROR on rcu/rcu/dev]
[also build test ERROR on linus/master v7.3-rc2 next-20260909]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Kunwu-Chan/srcutree-Skip-torture-to-big-transition-for-atomic-SRCU/20260910-121427
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rcu/linux.git rcu/dev
patch link:    https://lore.kernel.org/r/20260910041427.3579817-1-kunwu.chan%40gmail.com
patch subject: [PATCH] srcutree: Skip torture to-big transition for atomic SRCU
config: arm64-allnoconfig (https://download.01.org/0day-ci/archive/20260910/202609102229.DO9S18xW-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 16.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260910/202609102229.DO9S18xW-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/202609102229.DO9S18xW-lkp@intel.com/

All errors (new ones prefixed by >>):

   kernel/rcu/srcutree.c: In function 'srcu_torture_stats_print':
>> kernel/rcu/srcutree.c:2080:68: error: 'SRCU_READ_FLAVOR_ATOMIC' undeclared (first use in this function); did you mean 'SRCU_READ_FLAVOR_NMI'?
    2080 |         if (SRCU_SIZING_IS_TORTURE() && ssp->srcu_reader_flavor != SRCU_READ_FLAVOR_ATOMIC)
         |                                                                    ^~~~~~~~~~~~~~~~~~~~~~~
         |                                                                    SRCU_READ_FLAVOR_NMI
   kernel/rcu/srcutree.c:2080:68: note: each undeclared identifier is reported only once for each function it appears in


vim +2080 kernel/rcu/srcutree.c

  2031	
  2032	void srcu_torture_stats_print(struct srcu_struct *ssp, char *tt, char *tf)
  2033	{
  2034		int cpu;
  2035		int idx;
  2036		unsigned long s0 = 0, s1 = 0;
  2037		int ss_state = READ_ONCE(ssp->srcu_sup->srcu_size_state);
  2038		int ss_state_idx = ss_state;
  2039	
  2040		idx = ssp->srcu_ctrp - &ssp->sda->srcu_ctrs[0];
  2041		if (ss_state < 0 || ss_state >= ARRAY_SIZE(srcu_size_state_name))
  2042			ss_state_idx = ARRAY_SIZE(srcu_size_state_name) - 1;
  2043		pr_alert("%s%s Tree SRCU g%ld state %d (%s)",
  2044			 tt, tf, rcu_seq_current(&ssp->srcu_sup->srcu_gp_seq), ss_state,
  2045			 srcu_size_state_name[ss_state_idx]);
  2046		if (!ssp->sda) {
  2047			// Called after cleanup_srcu_struct(), perhaps.
  2048			pr_cont(" No per-CPU srcu_data structures (->sda == NULL).\n");
  2049		} else {
  2050			pr_cont(" per-CPU(idx=%d):", idx);
  2051			for_each_possible_cpu(cpu) {
  2052				unsigned long l0, l1;
  2053				unsigned long u0, u1;
  2054				long c0, c1;
  2055				struct srcu_data *sdp;
  2056	
  2057				sdp = per_cpu_ptr(ssp->sda, cpu);
  2058				u0 = data_race(atomic_long_read(&sdp->srcu_ctrs[!idx].srcu_unlocks));
  2059				u1 = data_race(atomic_long_read(&sdp->srcu_ctrs[idx].srcu_unlocks));
  2060	
  2061				/*
  2062				 * Make sure that a lock is always counted if the corresponding
  2063				 * unlock is counted.
  2064				 */
  2065				smp_rmb();
  2066	
  2067				l0 = data_race(atomic_long_read(&sdp->srcu_ctrs[!idx].srcu_locks));
  2068				l1 = data_race(atomic_long_read(&sdp->srcu_ctrs[idx].srcu_locks));
  2069	
  2070				c0 = l0 - u0;
  2071				c1 = l1 - u1;
  2072				pr_cont(" %d(%ld,%ld %c)",
  2073					cpu, c0, c1,
  2074					"C."[rcu_segcblist_empty(&sdp->srcu_cblist)]);
  2075				s0 += c0;
  2076				s1 += c1;
  2077			}
  2078			pr_cont(" T(%ld,%ld)\n", s0, s1);
  2079		}
> 2080		if (SRCU_SIZING_IS_TORTURE() && ssp->srcu_reader_flavor != SRCU_READ_FLAVOR_ATOMIC)
  2081			srcu_transition_to_big(ssp);
  2082	}
  2083	EXPORT_SYMBOL_GPL(srcu_torture_stats_print);
  2084	

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

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

* Re: [PATCH] srcutree: Skip torture to-big transition for atomic SRCU
  2026-09-10  4:14 [PATCH] srcutree: Skip torture to-big transition for atomic SRCU Kunwu Chan
  2026-09-10 14:33 ` kernel test robot
@ 2026-09-10 14:34 ` kernel test robot
  2026-09-10 16:54   ` Paul E. McKenney
  2026-09-10 16:53 ` Paul E. McKenney
  2 siblings, 1 reply; 7+ messages in thread
From: kernel test robot @ 2026-09-10 14:34 UTC (permalink / raw)
  To: Kunwu Chan, jiangshanlai, paulmck, josh, rostedt, mathieu.desnoyers
  Cc: llvm, oe-kbuild-all, rcu, linux-kernel, Kunwu Chan

Hi Kunwu,

kernel test robot noticed the following build errors:

[auto build test ERROR on rcu/rcu/dev]
[also build test ERROR on linus/master v7.3-rc2 next-20260909]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Kunwu-Chan/srcutree-Skip-torture-to-big-transition-for-atomic-SRCU/20260910-121427
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rcu/linux.git rcu/dev
patch link:    https://lore.kernel.org/r/20260910041427.3579817-1-kunwu.chan%40gmail.com
patch subject: [PATCH] srcutree: Skip torture to-big transition for atomic SRCU
config: s390-allnoconfig (https://download.01.org/0day-ci/archive/20260910/202609102247.8X7GUWSj-lkp@intel.com/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project d3db069999553568848400c84cbf815c03f5470f)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260910/202609102247.8X7GUWSj-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/202609102247.8X7GUWSj-lkp@intel.com/

All errors (new ones prefixed by >>):

>> kernel/rcu/srcutree.c:2080:61: error: use of undeclared identifier 'SRCU_READ_FLAVOR_ATOMIC'
    2080 |         if (SRCU_SIZING_IS_TORTURE() && ssp->srcu_reader_flavor != SRCU_READ_FLAVOR_ATOMIC)
         |                                                                    ^~~~~~~~~~~~~~~~~~~~~~~
   1 error generated.


vim +/SRCU_READ_FLAVOR_ATOMIC +2080 kernel/rcu/srcutree.c

  2031	
  2032	void srcu_torture_stats_print(struct srcu_struct *ssp, char *tt, char *tf)
  2033	{
  2034		int cpu;
  2035		int idx;
  2036		unsigned long s0 = 0, s1 = 0;
  2037		int ss_state = READ_ONCE(ssp->srcu_sup->srcu_size_state);
  2038		int ss_state_idx = ss_state;
  2039	
  2040		idx = ssp->srcu_ctrp - &ssp->sda->srcu_ctrs[0];
  2041		if (ss_state < 0 || ss_state >= ARRAY_SIZE(srcu_size_state_name))
  2042			ss_state_idx = ARRAY_SIZE(srcu_size_state_name) - 1;
  2043		pr_alert("%s%s Tree SRCU g%ld state %d (%s)",
  2044			 tt, tf, rcu_seq_current(&ssp->srcu_sup->srcu_gp_seq), ss_state,
  2045			 srcu_size_state_name[ss_state_idx]);
  2046		if (!ssp->sda) {
  2047			// Called after cleanup_srcu_struct(), perhaps.
  2048			pr_cont(" No per-CPU srcu_data structures (->sda == NULL).\n");
  2049		} else {
  2050			pr_cont(" per-CPU(idx=%d):", idx);
  2051			for_each_possible_cpu(cpu) {
  2052				unsigned long l0, l1;
  2053				unsigned long u0, u1;
  2054				long c0, c1;
  2055				struct srcu_data *sdp;
  2056	
  2057				sdp = per_cpu_ptr(ssp->sda, cpu);
  2058				u0 = data_race(atomic_long_read(&sdp->srcu_ctrs[!idx].srcu_unlocks));
  2059				u1 = data_race(atomic_long_read(&sdp->srcu_ctrs[idx].srcu_unlocks));
  2060	
  2061				/*
  2062				 * Make sure that a lock is always counted if the corresponding
  2063				 * unlock is counted.
  2064				 */
  2065				smp_rmb();
  2066	
  2067				l0 = data_race(atomic_long_read(&sdp->srcu_ctrs[!idx].srcu_locks));
  2068				l1 = data_race(atomic_long_read(&sdp->srcu_ctrs[idx].srcu_locks));
  2069	
  2070				c0 = l0 - u0;
  2071				c1 = l1 - u1;
  2072				pr_cont(" %d(%ld,%ld %c)",
  2073					cpu, c0, c1,
  2074					"C."[rcu_segcblist_empty(&sdp->srcu_cblist)]);
  2075				s0 += c0;
  2076				s1 += c1;
  2077			}
  2078			pr_cont(" T(%ld,%ld)\n", s0, s1);
  2079		}
> 2080		if (SRCU_SIZING_IS_TORTURE() && ssp->srcu_reader_flavor != SRCU_READ_FLAVOR_ATOMIC)
  2081			srcu_transition_to_big(ssp);
  2082	}
  2083	EXPORT_SYMBOL_GPL(srcu_torture_stats_print);
  2084	

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

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

* Re: [PATCH] srcutree: Skip torture to-big transition for atomic SRCU
  2026-09-10  4:14 [PATCH] srcutree: Skip torture to-big transition for atomic SRCU Kunwu Chan
  2026-09-10 14:33 ` kernel test robot
  2026-09-10 14:34 ` kernel test robot
@ 2026-09-10 16:53 ` Paul E. McKenney
  2026-09-11  2:12   ` KunWu Chan
  2 siblings, 1 reply; 7+ messages in thread
From: Paul E. McKenney @ 2026-09-10 16:53 UTC (permalink / raw)
  To: Kunwu Chan
  Cc: jiangshanlai, josh, rostedt, mathieu.desnoyers, rcu, linux-kernel

On Thu, Sep 10, 2026 at 12:14:27PM +0800, Kunwu Chan wrote:
> Atomic SRCU does not use the srcu_node combining tree.  Exclude it
> from the SRCU_SIZING_IS_TORTURE() transition in
> srcu_torture_stats_print().
> 
> Signed-off-by: Kunwu Chan <kunwu.chan@gmail.com>
> ---
>  kernel/rcu/srcutree.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c
> index d462102c6bb6..99d11fb4123a 100644
> --- a/kernel/rcu/srcutree.c
> +++ b/kernel/rcu/srcutree.c
> @@ -2421,7 +2421,7 @@ void srcu_torture_stats_print(struct srcu_struct *ssp, char *tt, char *tf)
>  		}
>  		pr_cont(" T(%ld,%ld)\n", s0, s1);
>  	}
> -	if (SRCU_SIZING_IS_TORTURE())
> +	if (SRCU_SIZING_IS_TORTURE() && ssp->srcu_reader_flavor != SRCU_READ_FLAVOR_ATOMIC)
>  		srcu_transition_to_big(ssp);
>  }

Much better, thank you!

Could you also please add an "else" clause with a WARN_ON_ONCE()
for ssp->srcu_reader_flavor == SRCU_READ_FLAVOR_ATOMIC?

This is after all a user error where someone said to torture atomic SRCU
but also said to transition to big.

							Thanx, Paul

>  EXPORT_SYMBOL_GPL(srcu_torture_stats_print);
> -- 
> 2.43.0
> 

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

* Re: [PATCH] srcutree: Skip torture to-big transition for atomic SRCU
  2026-09-10 14:34 ` kernel test robot
@ 2026-09-10 16:54   ` Paul E. McKenney
  0 siblings, 0 replies; 7+ messages in thread
From: Paul E. McKenney @ 2026-09-10 16:54 UTC (permalink / raw)
  To: kernel test robot
  Cc: Kunwu Chan, jiangshanlai, josh, rostedt, mathieu.desnoyers, llvm,
	oe-kbuild-all, rcu, linux-kernel

On Thu, Sep 10, 2026 at 10:34:21PM +0800, kernel test robot wrote:
> Hi Kunwu,
> 
> kernel test robot noticed the following build errors:
> 
> [auto build test ERROR on rcu/rcu/dev]
> [also build test ERROR on linus/master v7.3-rc2 next-20260909]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch#_base_tree_information]

Indeed, this patch would need to be applied to the "dev" branch of my
-rcu tree.

							Thanx, Paul

> url:    https://github.com/intel-lab-lkp/linux/commits/Kunwu-Chan/srcutree-Skip-torture-to-big-transition-for-atomic-SRCU/20260910-121427
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/rcu/linux.git rcu/dev
> patch link:    https://lore.kernel.org/r/20260910041427.3579817-1-kunwu.chan%40gmail.com
> patch subject: [PATCH] srcutree: Skip torture to-big transition for atomic SRCU
> config: s390-allnoconfig (https://download.01.org/0day-ci/archive/20260910/202609102247.8X7GUWSj-lkp@intel.com/config)
> compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project d3db069999553568848400c84cbf815c03f5470f)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260910/202609102247.8X7GUWSj-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/202609102247.8X7GUWSj-lkp@intel.com/
> 
> All errors (new ones prefixed by >>):
> 
> >> kernel/rcu/srcutree.c:2080:61: error: use of undeclared identifier 'SRCU_READ_FLAVOR_ATOMIC'
>     2080 |         if (SRCU_SIZING_IS_TORTURE() && ssp->srcu_reader_flavor != SRCU_READ_FLAVOR_ATOMIC)
>          |                                                                    ^~~~~~~~~~~~~~~~~~~~~~~
>    1 error generated.
> 
> 
> vim +/SRCU_READ_FLAVOR_ATOMIC +2080 kernel/rcu/srcutree.c
> 
>   2031	
>   2032	void srcu_torture_stats_print(struct srcu_struct *ssp, char *tt, char *tf)
>   2033	{
>   2034		int cpu;
>   2035		int idx;
>   2036		unsigned long s0 = 0, s1 = 0;
>   2037		int ss_state = READ_ONCE(ssp->srcu_sup->srcu_size_state);
>   2038		int ss_state_idx = ss_state;
>   2039	
>   2040		idx = ssp->srcu_ctrp - &ssp->sda->srcu_ctrs[0];
>   2041		if (ss_state < 0 || ss_state >= ARRAY_SIZE(srcu_size_state_name))
>   2042			ss_state_idx = ARRAY_SIZE(srcu_size_state_name) - 1;
>   2043		pr_alert("%s%s Tree SRCU g%ld state %d (%s)",
>   2044			 tt, tf, rcu_seq_current(&ssp->srcu_sup->srcu_gp_seq), ss_state,
>   2045			 srcu_size_state_name[ss_state_idx]);
>   2046		if (!ssp->sda) {
>   2047			// Called after cleanup_srcu_struct(), perhaps.
>   2048			pr_cont(" No per-CPU srcu_data structures (->sda == NULL).\n");
>   2049		} else {
>   2050			pr_cont(" per-CPU(idx=%d):", idx);
>   2051			for_each_possible_cpu(cpu) {
>   2052				unsigned long l0, l1;
>   2053				unsigned long u0, u1;
>   2054				long c0, c1;
>   2055				struct srcu_data *sdp;
>   2056	
>   2057				sdp = per_cpu_ptr(ssp->sda, cpu);
>   2058				u0 = data_race(atomic_long_read(&sdp->srcu_ctrs[!idx].srcu_unlocks));
>   2059				u1 = data_race(atomic_long_read(&sdp->srcu_ctrs[idx].srcu_unlocks));
>   2060	
>   2061				/*
>   2062				 * Make sure that a lock is always counted if the corresponding
>   2063				 * unlock is counted.
>   2064				 */
>   2065				smp_rmb();
>   2066	
>   2067				l0 = data_race(atomic_long_read(&sdp->srcu_ctrs[!idx].srcu_locks));
>   2068				l1 = data_race(atomic_long_read(&sdp->srcu_ctrs[idx].srcu_locks));
>   2069	
>   2070				c0 = l0 - u0;
>   2071				c1 = l1 - u1;
>   2072				pr_cont(" %d(%ld,%ld %c)",
>   2073					cpu, c0, c1,
>   2074					"C."[rcu_segcblist_empty(&sdp->srcu_cblist)]);
>   2075				s0 += c0;
>   2076				s1 += c1;
>   2077			}
>   2078			pr_cont(" T(%ld,%ld)\n", s0, s1);
>   2079		}
> > 2080		if (SRCU_SIZING_IS_TORTURE() && ssp->srcu_reader_flavor != SRCU_READ_FLAVOR_ATOMIC)
>   2081			srcu_transition_to_big(ssp);
>   2082	}
>   2083	EXPORT_SYMBOL_GPL(srcu_torture_stats_print);
>   2084	
> 
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki

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

* Re: [PATCH] srcutree: Skip torture to-big transition for atomic SRCU
  2026-09-10 16:53 ` Paul E. McKenney
@ 2026-09-11  2:12   ` KunWu Chan
  2026-09-11  4:07     ` Paul E. McKenney
  0 siblings, 1 reply; 7+ messages in thread
From: KunWu Chan @ 2026-09-11  2:12 UTC (permalink / raw)
  To: paulmck; +Cc: jiangshanlai, josh, rostedt, mathieu.desnoyers, rcu, linux-kernel

On Fri, Sep 11, 2026 at 12:53 AM Paul E. McKenney <paulmck@kernel.org> wrote:
>
> On Thu, Sep 10, 2026 at 12:14:27PM +0800, Kunwu Chan wrote:
> > Atomic SRCU does not use the srcu_node combining tree.  Exclude it
> > from the SRCU_SIZING_IS_TORTURE() transition in
> > srcu_torture_stats_print().
> >
> > Signed-off-by: Kunwu Chan <kunwu.chan@gmail.com>
> > ---
> >  kernel/rcu/srcutree.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c
> > index d462102c6bb6..99d11fb4123a 100644
> > --- a/kernel/rcu/srcutree.c
> > +++ b/kernel/rcu/srcutree.c
> > @@ -2421,7 +2421,7 @@ void srcu_torture_stats_print(struct srcu_struct *ssp, char *tt, char *tf)
> >               }
> >               pr_cont(" T(%ld,%ld)\n", s0, s1);
> >       }
> > -     if (SRCU_SIZING_IS_TORTURE())
> > +     if (SRCU_SIZING_IS_TORTURE() && ssp->srcu_reader_flavor != SRCU_READ_FLAVOR_ATOMIC)
> >               srcu_transition_to_big(ssp);
> >  }
>
> Much better, thank you!
>
> Could you also please add an "else" clause with a WARN_ON_ONCE()
> for ssp->srcu_reader_flavor == SRCU_READ_FLAVOR_ATOMIC?
>
> This is after all a user error where someone said to torture atomic SRCU
> but also said to transition to big.

Thanks, Paul.
Agreed. I'll add the warning in the next version:
if (SRCU_SIZING_IS_TORTURE()) {
        if (WARN_ON_ONCE(ssp->srcu_reader_flavor ==
                         SRCU_READ_FLAVOR_ATOMIC))
                return;
        srcu_transition_to_big(ssp);
}

This keeps atomic SRCU out of the to-big transition while exposing
the invalid torture configuration.

Thanks,
Kunwu

>
>                                                         Thanx, Paul
>
> >  EXPORT_SYMBOL_GPL(srcu_torture_stats_print);
> > --
> > 2.43.0
> >

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

* Re: [PATCH] srcutree: Skip torture to-big transition for atomic SRCU
  2026-09-11  2:12   ` KunWu Chan
@ 2026-09-11  4:07     ` Paul E. McKenney
  0 siblings, 0 replies; 7+ messages in thread
From: Paul E. McKenney @ 2026-09-11  4:07 UTC (permalink / raw)
  To: KunWu Chan
  Cc: jiangshanlai, josh, rostedt, mathieu.desnoyers, rcu, linux-kernel

On Fri, Sep 11, 2026 at 10:12:37AM +0800, KunWu Chan wrote:
> On Fri, Sep 11, 2026 at 12:53 AM Paul E. McKenney <paulmck@kernel.org> wrote:
> >
> > On Thu, Sep 10, 2026 at 12:14:27PM +0800, Kunwu Chan wrote:
> > > Atomic SRCU does not use the srcu_node combining tree.  Exclude it
> > > from the SRCU_SIZING_IS_TORTURE() transition in
> > > srcu_torture_stats_print().
> > >
> > > Signed-off-by: Kunwu Chan <kunwu.chan@gmail.com>
> > > ---
> > >  kernel/rcu/srcutree.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c
> > > index d462102c6bb6..99d11fb4123a 100644
> > > --- a/kernel/rcu/srcutree.c
> > > +++ b/kernel/rcu/srcutree.c
> > > @@ -2421,7 +2421,7 @@ void srcu_torture_stats_print(struct srcu_struct *ssp, char *tt, char *tf)
> > >               }
> > >               pr_cont(" T(%ld,%ld)\n", s0, s1);
> > >       }
> > > -     if (SRCU_SIZING_IS_TORTURE())
> > > +     if (SRCU_SIZING_IS_TORTURE() && ssp->srcu_reader_flavor != SRCU_READ_FLAVOR_ATOMIC)
> > >               srcu_transition_to_big(ssp);
> > >  }
> >
> > Much better, thank you!
> >
> > Could you also please add an "else" clause with a WARN_ON_ONCE()
> > for ssp->srcu_reader_flavor == SRCU_READ_FLAVOR_ATOMIC?
> >
> > This is after all a user error where someone said to torture atomic SRCU
> > but also said to transition to big.
> 
> Thanks, Paul.
> Agreed. I'll add the warning in the next version:
> if (SRCU_SIZING_IS_TORTURE()) {
>         if (WARN_ON_ONCE(ssp->srcu_reader_flavor ==
>                          SRCU_READ_FLAVOR_ATOMIC))
>                 return;
>         srcu_transition_to_big(ssp);
> }
> 
> This keeps atomic SRCU out of the to-big transition while exposing
> the invalid torture configuration.

Again, sounds good!

							Thanx, Paul

> Thanks,
> Kunwu
> 
> >
> >                                                         Thanx, Paul
> >
> > >  EXPORT_SYMBOL_GPL(srcu_torture_stats_print);
> > > --
> > > 2.43.0
> > >

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

end of thread, other threads:[~2026-09-11  4:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-10  4:14 [PATCH] srcutree: Skip torture to-big transition for atomic SRCU Kunwu Chan
2026-09-10 14:33 ` kernel test robot
2026-09-10 14:34 ` kernel test robot
2026-09-10 16:54   ` Paul E. McKenney
2026-09-10 16:53 ` Paul E. McKenney
2026-09-11  2:12   ` KunWu Chan
2026-09-11  4:07     ` 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

all inboxes | Powered by JetHome®