From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DEA59C433F5 for ; Tue, 4 Oct 2022 15:58:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229611AbiJDP6W (ORCPT ); Tue, 4 Oct 2022 11:58:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229757AbiJDP6Q (ORCPT ); Tue, 4 Oct 2022 11:58:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAFBD5603A; Tue, 4 Oct 2022 08:58:15 -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 48F9E61484; Tue, 4 Oct 2022 15:58:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A9F3EC433D6; Tue, 4 Oct 2022 15:58:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664899094; bh=JC4YwkkCTW0TRwKxWdhDW2bxOC4RPbovKCuk7XuI4ac=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=IXPTLaPnTLb6OwV8JO96No2XjxG7VkZfaNAuLNQF+Zfvu1IL3UzEqFTp3IPF3H2LN JJZPYvx+Lav3elVd8ZpWuTgEwgfLPcB+hgMdtI9PTd+bJpamAuiDKu330tpeaLaqpL 9SO0wKE0vN3wtOSpZfYUjdrwRC9LiOzHjKLOBfuXnagM/YXbNHDLnoJePvsPxedWTS BaVpHrcgQfJ1uwc8l8dcLh+t3i8c88+NlVjcY39TLc0pr5kcoiXPUrlLLn+3qIkR3I vlf+2SXlC6DHYK8c1cheK1C4Z2+yTHvBPEcuW1W3gUATbNI8VLqVLBJWiwuvvNu84b VaT9g9994khcQ== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 521235C0641; Tue, 4 Oct 2022 08:58:14 -0700 (PDT) Date: Tue, 4 Oct 2022 08:58:14 -0700 From: "Paul E. McKenney" To: Uladzislau Rezki Cc: "Joel Fernandes (Google)" , rcu@vger.kernel.org, linux-kernel@vger.kernel.org, rushikesh.s.kadam@intel.com, neeraj.iitr10@gmail.com, frederic@kernel.org, rostedt@goodmis.org, youssefesmat@google.com, surenb@google.com Subject: Re: [PATCH v7 02/11] rcu: Make call_rcu() lazy to save power Message-ID: <20221004155814.GG4196@paulmck-ThinkPad-P17-Gen-1> Reply-To: paulmck@kernel.org References: <20221004024157.2470238-1-joel@joelfernandes.org> <20221004024157.2470238-3-joel@joelfernandes.org> <20221004133004.GD4196@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 04, 2022 at 04:53:09PM +0200, Uladzislau Rezki wrote: > On Tue, Oct 04, 2022 at 06:30:04AM -0700, Paul E. McKenney wrote: > > On Tue, Oct 04, 2022 at 01:41:38PM +0200, Uladzislau Rezki wrote: > > > > trace_rcu_nocb_wake(rcu_state.name, rdp->cpu, TPS("Check")); > > > > rcu_nocb_lock_irqsave(rdp, flags); > > > > lockdep_assert_held(&rdp->nocb_lock); > > > > bypass_ncbs = rcu_cblist_n_cbs(&rdp->nocb_bypass); > > > > - if (bypass_ncbs && > > > > + lazy_ncbs = READ_ONCE(rdp->lazy_len); > > > > + > > > > + if (bypass_ncbs && (lazy_ncbs == bypass_ncbs) && > > > > + (time_after(j, READ_ONCE(rdp->nocb_bypass_first) + jiffies_till_flush) || > > > > + bypass_ncbs > 2 * qhimark)) { > > > Do you know why we want double "qhimark" threshold? It is not only this > > > place, there are several. I am asking because it is not expected by the > > > user. > > > > OK, I will bite... What does the user expect? Or, perhaps a better > > question, how is this choice causing the user problems? > > > Yesterday when i was checking the lazy-v6 on Android i noticed the following: > > > ... > rcuop/4-48 [006] d..1 184.780328: rcu_batch_start: rcu_preempt CBs=15572 bl=121 > rcuop/6-62 [000] d..1 184.796939: rcu_batch_start: rcu_preempt CBs=21503 bl=167 > rcuop/6-62 [003] d..1 184.800706: rcu_batch_start: rcu_preempt CBs=24677 bl=192 > rcuop/6-62 [005] d..1 184.803773: rcu_batch_start: rcu_preempt CBs=27117 bl=211 > rcuop/6-62 [005] d..1 184.805732: rcu_batch_start: rcu_preempt CBs=22391 bl=174 > rcuop/6-62 [005] d..1 184.809083: rcu_batch_start: rcu_preempt CBs=12554 bl=98 > rcuop/6-62 [005] d..1 184.824228: rcu_batch_start: rcu_preempt CBs=16177 bl=126 > rcuop/4-48 [006] d..1 184.836193: rcu_batch_start: rcu_preempt CBs=24129 bl=188 > rcuop/4-48 [006] d..1 184.844147: rcu_batch_start: rcu_preempt CBs=25854 bl=201 > rcuop/4-48 [006] d..1 184.847257: rcu_batch_start: rcu_preempt CBs=21328 bl=166 > rcuop/4-48 [006] d..1 184.852128: rcu_batch_start: rcu_preempt CBs=21710 bl=169 > ... > > > On my device the "qhimark" is set to: > > > XQ-CT54:/sys/module/rcutree/parameters # cat qhimark > 10000 > XQ-CT54:/sys/module/rcutree/parameters # > > > so i expect that once we pass 10 000 callbacks threshold the flush > should occur. This parameter gives us an opportunity to control a > memory that should be reclaimed sooner or later. I did understand that you were surprised. But what problem did this cause other than you being surprised? Thanx, Paul