Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3373620iog; Mon, 27 Jun 2022 14:50:24 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vtY8LNCTTO0oQQp6l495fcxWxbWMpp9ygEha2PxkyUQD2t2Y+tKjrwYHm+W9p7vNmXmyWh X-Received: by 2002:a17:90b:4a0b:b0:1ed:4a56:d805 with SMTP id kk11-20020a17090b4a0b00b001ed4a56d805mr14783801pjb.246.1656366624238; Mon, 27 Jun 2022 14:50:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656366624; cv=none; d=google.com; s=arc-20160816; b=ucdREOWdnBdNxltrEH4I++3o7OgPWapUcGbXy36LPHkpaGe343jesgeN//4h6Fhnw2 Gn/jPgNoSJJafAa8f+D+AH6gp00sggDZfTG7zAGP6iJvVpngX1BR2Gxsmf/FejHAH1Jf qH9l+cj5SM4phgjoBP5puutAO7WNF2j5mKgxasdhEIzrd1D3l655LV917x7JnTxu0Zjo iqj5QsgR+qLnW7m8Ia4EyKZQjancY5PRbS5Durclw6R1e0kI2R5oe0MSbwisxiBOVW/2 2rPvop2039CL89OzNd7ijy3nHY0ywAIG7Ge0D8deguiLVxSskpKZ8qwjwhZuUiGdp0dy qcgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=/YbERrbjOtZ+XXABZCOHiYzfUmsdmisQ5VuDueGbzXo=; b=c1RWkFYCWfRkoHSkAhsdAyJVvrDo/qdFLQmoT8C/GcMXfXoDfa88hCg8U6Rc6ylHeY Rzsqwjx9wWpvfSKDdd/K06IS2k+eYI9tR8oACJwviqPAXo+UwMvmK7AA3IlSNlmBdL5E MywtiJTCNPT4FO8PGtgMAHQhuKDMxt2jwf5uMYtBvra7Lh2RKtvkt0RdrU/1j1Bk1tN5 OeBA6oeTdXqy6Fp32ci3pMpXwwBgtCP1lHFu+45BGMQhv0K3bFT3yF2vdrnbEio6bT4S sXtHQPO+tDYttR3yvjMM27AN96vmT5FjxuHcj32Zp8gKA8tOol0GG4Y3ODaxHzUyJFyY XdEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rfK9P8pH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f13-20020a056a00238d00b0051038ecbe35si13499298pfc.201.2022.06.27.14.50.11; Mon, 27 Jun 2022 14:50:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rfK9P8pH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S241394AbiF0VoE (ORCPT + 99 others); Mon, 27 Jun 2022 17:44:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238130AbiF0VoC (ORCPT ); Mon, 27 Jun 2022 17:44:02 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B16B3C4A; Mon, 27 Jun 2022 14:44:01 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4E4A861807; Mon, 27 Jun 2022 21:44:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0E6AC34115; Mon, 27 Jun 2022 21:44:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656366240; bh=LfrOR1GLG7WwBLTfzlsmnGUM2EA+lpkFh7SvKxOWWKk=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=rfK9P8pHno5T6lJi+V+mTVgizJbb+g2VPIRs539BQmf2FNvcI8Aw0Dr5HR0IEt0ks Z9yEFU06HjOCrwHbJJbUKNVCdextka6vpZra5oB9WBwVwehqWt7wBsZRjzKyl1KUo6 6iRvj0LQzzCTiZEoJ/P59IZRJm5d6X1IFuxbKR0RbS4FzdGRjC2kcULuFHqj8S7rqQ UYK4nenczXJ4bGwDkhHAZr54T9ViUNhqAMysLaGQxYeip7tEyF3fJSIdtNlU8Q5ja/ TFRVs7A4sqPCaK+TMjw3Sg5U4/vCbeN4C9rUXPOAsfYssouIw1TkM9T0RJptzZpx4g qgwM0La+5GIMQ== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id A87D35C04B1; Mon, 27 Jun 2022 14:43:59 -0700 (PDT) Date: Mon, 27 Jun 2022 14:43:59 -0700 From: "Paul E. McKenney" To: Joel Fernandes Cc: Uladzislau Rezki , rcu@vger.kernel.org, linux-kernel@vger.kernel.org, rushikesh.s.kadam@intel.com, neeraj.iitr10@gmail.com, frederic@kernel.org, rostedt@goodmis.org, vineeth@bitbyteword.org Subject: Re: [PATCH v2 8/8] rcu/kfree: Fix kfree_rcu_shrink_count() return value Message-ID: <20220627214359.GQ1790663@paulmck-ThinkPad-P17-Gen-1> Reply-To: paulmck@kernel.org References: <20220622225102.2112026-1-joel@joelfernandes.org> <20220622225102.2112026-10-joel@joelfernandes.org> <20220627205907.GM1790663@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 27, 2022 at 09:18:13PM +0000, Joel Fernandes wrote: > On Mon, Jun 27, 2022 at 01:59:07PM -0700, Paul E. McKenney wrote: > > On Mon, Jun 27, 2022 at 08:56:43PM +0200, Uladzislau Rezki wrote: > > > > As per the comments in include/linux/shrinker.h, .count_objects callback > > > > should return the number of freeable items, but if there are no objects > > > > to free, SHRINK_EMPTY should be returned. The only time 0 is returned > > > > should be when we are unable to determine the number of objects, or the > > > > cache should be skipped for another reason. > > > > > > > > Signed-off-by: Joel Fernandes (Google) > > > > --- > > > > 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 711679d10cbb..935788e8d2d7 100644 > > > > --- a/kernel/rcu/tree.c > > > > +++ b/kernel/rcu/tree.c > > > > @@ -3722,7 +3722,7 @@ kfree_rcu_shrink_count(struct shrinker *shrink, struct shrink_control *sc) > > > > atomic_set(&krcp->backoff_page_cache_fill, 1); > > > > } > > > > > > > > - return count; > > > > + return count == 0 ? SHRINK_EMPTY : count; > > > > } > > > > > > > > static unsigned long > > > > -- > > > > 2.37.0.rc0.104.g0611611a94-goog > > > > > > > Looks good to me! > > > > > > Reviewed-by: Uladzislau Rezki (Sony) > > > > Now that you mention it, this does look independent of the rest of > > the series. I have pulled it in with Uladzislau's Reviewed-by. > > Thanks Paul and Vlad! > > Paul, apologies for being quiet. I have been working on the series and the > review comments carefully. I appreciate your help with this work. Not a problem. After all, this stuff is changing some of the trickier parts of RCU. We must therefore assume that some significant time and effort will be required to get it right. Thanx, Paul