lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200604163100.GB29598@paulmck-ThinkPad-P72>
Date:   Thu, 4 Jun 2020 09:31:00 -0700
From:   "Paul E. McKenney" <paulmck@...nel.org>
To:     Uladzislau Rezki <urezki@...il.com>
Cc:     Peter Enderborg <peter.enderborg@...y.com>,
        Josh Triplett <josh@...htriplett.org>,
        Steven Rostedt <rostedt@...dmis.org>,
        Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
        Lai Jiangshan <jiangshanlai@...il.com>,
        Joel Fernandes <joel@...lfernandes.org>, rcu@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] rcu: Stop shrinker loop

On Thu, Jun 04, 2020 at 03:42:55PM +0200, Uladzislau Rezki wrote:
> On Thu, Jun 04, 2020 at 12:23:20PM +0200, Peter Enderborg wrote:
> > The count and scan can be separated in time. It is a fair chance
> > that all work is already done when the scan starts. It
> > then might retry. This is can be avoided with returning SHRINK_STOP.
> > 
> > Signed-off-by: Peter Enderborg <peter.enderborg@...y.com>
> > ---
> >  kernel/rcu/tree.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> > index c716eadc7617..8b36c6b2887d 100644
> > --- a/kernel/rcu/tree.c
> > +++ b/kernel/rcu/tree.c
> > @@ -3310,7 +3310,7 @@ kfree_rcu_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)
> >  			break;
> >  	}
> >  
> > -	return freed;
> > +	return freed == 0 ? SHRINK_STOP : freed;
> >  }
> >  
> The loop will be stopped anyway sooner or later, but sooner is better :)
> To me that change makes sense.
> 
> Reviewed-by: Uladzislau Rezki (Sony) <urezki@...il.com>

Queued, thank you both!

							Thanx, Paul

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ