diff mbox series

[RFC,v1,04/14] cred: Move call_rcu() to call_rcu_lazy()

Message ID 20220512030442.2530552-5-joel@joelfernandes.org (mailing list archive)
State Superseded
Headers show
Series Implement call_rcu_lazy() and miscellaneous fixes | expand

Commit Message

Joel Fernandes May 12, 2022, 3:04 a.m. UTC
This is required to prevent callbacks triggering RCU machinery too
quickly and too often, which adds more power to the system.

Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
---
 kernel/cred.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Paul E. McKenney May 13, 2022, 12:02 a.m. UTC | #1
On Thu, May 12, 2022 at 03:04:32AM +0000, Joel Fernandes (Google) wrote:
> This is required to prevent callbacks triggering RCU machinery too
> quickly and too often, which adds more power to the system.
> 
> Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>

The put_cred_rcu() does some debugging that would be less effective
with a 10-second delay.  Which is probably OK assuming that significant
testing happens on CONFIG_RCU_LAZY=n kernels.

							Thanx, Paul

> ---
>  kernel/cred.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/cred.c b/kernel/cred.c
> index 933155c96922..f4d69d7f2763 100644
> --- a/kernel/cred.c
> +++ b/kernel/cred.c
> @@ -150,7 +150,7 @@ void __put_cred(struct cred *cred)
>  	if (cred->non_rcu)
>  		put_cred_rcu(&cred->rcu);
>  	else
> -		call_rcu(&cred->rcu, put_cred_rcu);
> +		call_rcu_lazy(&cred->rcu, put_cred_rcu);
>  }
>  EXPORT_SYMBOL(__put_cred);
>  
> -- 
> 2.36.0.550.gb090851708-goog
>
Joel Fernandes May 14, 2022, 2:41 p.m. UTC | #2
On Thu, May 12, 2022 at 05:02:53PM -0700, Paul E. McKenney wrote:
> On Thu, May 12, 2022 at 03:04:32AM +0000, Joel Fernandes (Google) wrote:
> > This is required to prevent callbacks triggering RCU machinery too
> > quickly and too often, which adds more power to the system.
> > 
> > Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
> 
> The put_cred_rcu() does some debugging that would be less effective
> with a 10-second delay.  Which is probably OK assuming that significant
> testing happens on CONFIG_RCU_LAZY=n kernels.

Good point, I'll add that to the commit message, thanks!

thanks,

 - Joel

> 							Thanx, Paul
> 
> > ---
> >  kernel/cred.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/kernel/cred.c b/kernel/cred.c
> > index 933155c96922..f4d69d7f2763 100644
> > --- a/kernel/cred.c
> > +++ b/kernel/cred.c
> > @@ -150,7 +150,7 @@ void __put_cred(struct cred *cred)
> >  	if (cred->non_rcu)
> >  		put_cred_rcu(&cred->rcu);
> >  	else
> > -		call_rcu(&cred->rcu, put_cred_rcu);
> > +		call_rcu_lazy(&cred->rcu, put_cred_rcu);
> >  }
> >  EXPORT_SYMBOL(__put_cred);
> >  
> > -- 
> > 2.36.0.550.gb090851708-goog
> >
diff mbox series

Patch

diff --git a/kernel/cred.c b/kernel/cred.c
index 933155c96922..f4d69d7f2763 100644
--- a/kernel/cred.c
+++ b/kernel/cred.c
@@ -150,7 +150,7 @@  void __put_cred(struct cred *cred)
 	if (cred->non_rcu)
 		put_cred_rcu(&cred->rcu);
 	else
-		call_rcu(&cred->rcu, put_cred_rcu);
+		call_rcu_lazy(&cred->rcu, put_cred_rcu);
 }
 EXPORT_SYMBOL(__put_cred);