Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1525102ybg; Thu, 4 Jun 2020 11:54:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyfYee7rlu0cQjcCrmVgJcpB+jbVyKtXMhHFMOi3SRAY/A0Q4CfPdJLFwwWKxkgwSKTYUgE X-Received: by 2002:a05:6402:1b01:: with SMTP id by1mr5610012edb.20.1591296854102; Thu, 04 Jun 2020 11:54:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591296854; cv=none; d=google.com; s=arc-20160816; b=RD3Z2OS1U44qDB3d3tu9B16L+3FELQksuVy88eBjWumSMjii4pMdHn45kihFX072n5 +cm/L1UxFPwyQyQj/kgEkyro24JSg0GqKxFUYmbbViDpvME4hQkANWSEfy/p50wjbIcm 0DKdPEQ1q9LfjO/mDYC41k7tLajftWQTy8cW0Jo52onCD2W084ccny5Ji0lENVKEagG5 uwKxD45QKCvSPPl5w1AVmgf4DyyfPSHs21AkfWt7kKsPQZ82wsU8SX9izhdX+/p6BJ8h SrIXc4mr8P9oz01Qhudzh3A6Ze08beKiB0AdlX+Vim6rBHG4owo8CJae/4lsxHCa0xEL LPyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=lAoEHRmNANShKMXxZQ/W4hh76hvOjhLsxr4gQpcEO7o=; b=RUPEBJRq2tBmI/IxnVyuZG3yjXHFN5wz8nO/nITab9V12D2EdnPjk1WGFrChfNL2uF fQp1NJkPl2dsuqvLCe85X8A0I9sNqZLCdNyava2G3mCMx5pdkLU0aZyehpJydd7zq8ra 9vTumMAek98YzBhVGavSKkwwNzJwXWgueumUTvOTrgJeO/ANYt5SHwd2tELFolMeOwzo NJCzO2sKGpfEPLVujpcQ3F4LWc2JSDLUZ0A40p9Kgnu9kMcb5xnGQXzEw0qMbsf3EI6R MnOaylNouxSLVCyr+sSjshLq4nK7svK7iuTZC308NnM0q0f02Dt75BflGb+JjI9d7ljB pzhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uV9GQ7XZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oy12si2143086ejb.654.2020.06.04.11.53.51; Thu, 04 Jun 2020 11:54:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uV9GQ7XZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729715AbgFDQbA (ORCPT + 99 others); Thu, 4 Jun 2020 12:31:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:48418 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729115AbgFDQbA (ORCPT ); Thu, 4 Jun 2020 12:31:00 -0400 Received: from paulmck-ThinkPad-P72.home (50-39-105-78.bvtn.or.frontiernet.net [50.39.105.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 260AA206DC; Thu, 4 Jun 2020 16:31:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591288260; bh=p22Qks7bzkvMwOfKr4OS5tjK01cXYo3wKjWBTk6+0r4=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=uV9GQ7XZ003JbvFHFVSz63OBBEqFTRLALl6oVWQ4yfQ9dpq11k7ya0hsCfTXFRHLa TFNkkZQI46i3s3lfPSwRZUD8h19yU6TOb/1ACMlfvrKGQ4yK28x0Xmv0ktc6JPfmys nDkq8YHA/Yi15oa7Wa3949Ccr6aUbWhS6FGGa6DY= Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id 0B6F835228BC; Thu, 4 Jun 2020 09:31:00 -0700 (PDT) Date: Thu, 4 Jun 2020 09:31:00 -0700 From: "Paul E. McKenney" To: Uladzislau Rezki Cc: Peter Enderborg , Josh Triplett , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Joel Fernandes , rcu@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] rcu: Stop shrinker loop Message-ID: <20200604163100.GB29598@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: <20200604102320.15914-1-peter.enderborg@sony.com> <20200604134255.GA24897@pc636> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200604134255.GA24897@pc636> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > --- > > 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) Queued, thank you both! Thanx, Paul