Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1314757ybg; Thu, 4 Jun 2020 06:45:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCNuypeFVl1awxzfg/QC7p/E0QTyNnmVvHc139fHStvR4bdJrj3x3TSBWUDjLVZnRn7xW6 X-Received: by 2002:aa7:d785:: with SMTP id s5mr4598692edq.17.1591278353637; Thu, 04 Jun 2020 06:45:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591278353; cv=none; d=google.com; s=arc-20160816; b=cj6ncc2vTv4YjblKht5VxBZQDicxMeXjrht1yXA48iwSUK3z62YcqFwQoLA4Sr4le5 clU4aKjkbs+AgzGi20qDEYGsHHMgPsssBt1hcRFnL1S7blsb/Uw2eGZD/GDH3fKB5anw 4lC8YwNAOkXpyzQGOAkPVtzjNSO+xN76euwrtId0kdYOupsVLGxw1FFP8Dyb8ta9WThl VjOIFnhPxmZ+B/3SKFKLpXiXwelc8vp9waUUpAmm3S2M91Y5HAB1FwQokzxjmA2xsAGU lri6/rHl9/kJE1xOd2219N4OP9xhX+LDnD3xIYvofHVaCy9vfmhNtZXwi+3RJ7XulWrC qI9w== 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:message-id:subject:cc :to:date:from:dkim-signature; bh=pD3DL1EaqqhfcWp/JmI04Moao7zjsJCQcgkS8UaxqlM=; b=YXH1MqRJH5uqFlUwLWUDk5r5nRT9hvp+KZ4GUqJm8fdQtvz5xzzJv0OVp69OovW3dP iLGDVp52j7pj9/H7R1Moq0rS7ZhYvKpC512QRNSPmMj4SamlCKf/DYdQt61tugFUGIg+ rCWPQq/hkU7sVlYP/Xnnvl1VEyt1oIzPZGrioAzf1Gr1Sc9kMNFHxUrEkVbeQowJbtUU +MJHR0dam7eMSlNWMktWQIE7hzoDU0v79uXNvyHFV4bQGKHfJ1y9j3Bopvz6+PO3N8zS dmfWQ2weq6pFkE2mHPs36ITR3M+xlbsQG3ltflKZO0EvPGEYLRq8f1zMFHPG7jWfc9hR 4Gmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MKPFfTyN; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h7si1634793edt.259.2020.06.04.06.45.30; Thu, 04 Jun 2020 06:45:53 -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=@gmail.com header.s=20161025 header.b=MKPFfTyN; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728638AbgFDNnE (ORCPT + 99 others); Thu, 4 Jun 2020 09:43:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728323AbgFDNnD (ORCPT ); Thu, 4 Jun 2020 09:43:03 -0400 Received: from mail-lf1-x144.google.com (mail-lf1-x144.google.com [IPv6:2a00:1450:4864:20::144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5991C08C5C0; Thu, 4 Jun 2020 06:43:01 -0700 (PDT) Received: by mail-lf1-x144.google.com with SMTP id h188so3621561lfd.7; Thu, 04 Jun 2020 06:43:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=pD3DL1EaqqhfcWp/JmI04Moao7zjsJCQcgkS8UaxqlM=; b=MKPFfTyNBu5xL7UVO/owP88fZoQ+vKDXkLQNZsqxE0/VkuzbWZiZ+Ceyej+3Ql5fxD txySRAOTxRKovhF50vbUYe/Xh/IsfP/7AZNMEc9o98vTKJe4LpFau4//de0QUq46kFPA aHonJp59+xVtgS//Y0qZ5SLBzJVR+btTICuCihHpdPWhUjPuzgIdmR4cxUjANfqw3eo0 frdGIX+YmRKYML2LAiAH0JQtpAhbdixw8Cylog63L9jzrF23xMBiqhuPbAJFrnh/Qign vbZ5jz69ZjJSlIJW9ee2HApvVygDUoF9K5HV7vPgYCHz9YctFyYpAOCpiuWiaSF8R+OB +z0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=pD3DL1EaqqhfcWp/JmI04Moao7zjsJCQcgkS8UaxqlM=; b=L1xF47CGVQiOjtn/TOl/wqHvbZevTeLADCz/mv1PJBOTcaEMUCZy1bwZae1rksBMjq HgqfG/NXTexerZvFOli+KsPz5Lm5BJEu7aRVUFcfWbSXD3Xzmzed/F6WhjfDnnCmtzZl crJmPCp8Ckuc6i5pu5E2b4Ff961zXn48JQpuVsodoGdEam4DKK1r3WQKzDkD2BZ1VDab 97CK7vx+NgKG2lxOrQRFyZwt7ldLKitLH/GdVzSAaY8hLO5RhCdQLGPZZtW750teZwWg bmPqNyScwlpxRouQQPVD8IcM0mrd3CYYnhptMTthXc8COvDJIvS4vUHg8ltNeAsxyEKp 4Xkg== X-Gm-Message-State: AOAM533hpnIxqo7ZJCn2JbIAqtMR4AV/3XgILwA7NmomXYWUsya51sYe DfFDdRNtggYygPc0X78+lZk= X-Received: by 2002:ac2:5094:: with SMTP id f20mr2669227lfm.128.1591278179989; Thu, 04 Jun 2020 06:42:59 -0700 (PDT) Received: from pc636 (h5ef52e31.seluork.dyn.perspektivbredband.net. [94.245.46.49]) by smtp.gmail.com with ESMTPSA id s8sm58463ljh.101.2020.06.04.06.42.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jun 2020 06:42:57 -0700 (PDT) From: Uladzislau Rezki X-Google-Original-From: Uladzislau Rezki Date: Thu, 4 Jun 2020 15:42:55 +0200 To: Peter Enderborg , "Paul E . McKenney" Cc: "Paul E . McKenney" , 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: <20200604134255.GA24897@pc636> References: <20200604102320.15914-1-peter.enderborg@sony.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200604102320.15914-1-peter.enderborg@sony.com> User-Agent: Mutt/1.10.1 (2018-07-13) 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 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) -- Vlad Rezki