All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] srcu: Release early_srcu resources when no longer in use
@ 2022-11-10  7:30 Zqiang
  2022-11-11  7:46 ` Paul E. McKenney
  0 siblings, 1 reply; 2+ messages in thread
From: Zqiang @ 2022-11-10  7:30 UTC (permalink / raw)
  To: paulmck, frederic, joel; +Cc: rcu, linux-kernel

When the "rcupdate.rcu_self_test = 1" is set in bootargs and CONFIG_SRCU
option is enabled, the early_srcu will be tested, currently, for TREE SRCU,
if "srcutree.convert_to_big = 1" is set, the srcu_node structure will be
allocated at invoke init_srcu_struct_fields() time, after the test is
completed, the early_srcu will not be used.
Therefore, this commit invoke cleanup_srcu_struct() to release srcu_node
structure.

Signed-off-by: Zqiang <qiang1.zhang@intel.com>
---
 kernel/rcu/update.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c
index 738842c4886b..a05e23648c6b 100644
--- a/kernel/rcu/update.c
+++ b/kernel/rcu/update.c
@@ -589,6 +589,7 @@ static int rcu_verify_early_boot_tests(void)
 			early_boot_test_counter++;
 			srcu_barrier(&early_srcu);
 			WARN_ON_ONCE(!poll_state_synchronize_srcu(&early_srcu, early_srcu_cookie));
+			cleanup_srcu_struct(&early_srcu);
 		}
 	}
 	if (rcu_self_test_counter != early_boot_test_counter) {
-- 
2.25.1


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

* Re: [PATCH] srcu: Release early_srcu resources when no longer in use
  2022-11-10  7:30 [PATCH] srcu: Release early_srcu resources when no longer in use Zqiang
@ 2022-11-11  7:46 ` Paul E. McKenney
  0 siblings, 0 replies; 2+ messages in thread
From: Paul E. McKenney @ 2022-11-11  7:46 UTC (permalink / raw)
  To: Zqiang; +Cc: frederic, joel, rcu, linux-kernel

On Thu, Nov 10, 2022 at 03:30:13PM +0800, Zqiang wrote:
> When the "rcupdate.rcu_self_test = 1" is set in bootargs and CONFIG_SRCU
> option is enabled, the early_srcu will be tested, currently, for TREE SRCU,
> if "srcutree.convert_to_big = 1" is set, the srcu_node structure will be
> allocated at invoke init_srcu_struct_fields() time, after the test is
> completed, the early_srcu will not be used.
> Therefore, this commit invoke cleanup_srcu_struct() to release srcu_node
> structure.
> 
> Signed-off-by: Zqiang <qiang1.zhang@intel.com>

Queued for further review and testing, thank you!

Also with the usual wordsmithing, so please check.

							Thanx, Paul

> ---
>  kernel/rcu/update.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c
> index 738842c4886b..a05e23648c6b 100644
> --- a/kernel/rcu/update.c
> +++ b/kernel/rcu/update.c
> @@ -589,6 +589,7 @@ static int rcu_verify_early_boot_tests(void)
>  			early_boot_test_counter++;
>  			srcu_barrier(&early_srcu);
>  			WARN_ON_ONCE(!poll_state_synchronize_srcu(&early_srcu, early_srcu_cookie));
> +			cleanup_srcu_struct(&early_srcu);
>  		}
>  	}
>  	if (rcu_self_test_counter != early_boot_test_counter) {
> -- 
> 2.25.1
> 

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

end of thread, other threads:[~2022-11-11  7:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-10  7:30 [PATCH] srcu: Release early_srcu resources when no longer in use Zqiang
2022-11-11  7:46 ` 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.