Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp1061887rwb; Sat, 3 Sep 2022 07:47:56 -0700 (PDT) X-Google-Smtp-Source: AA6agR7rqSm27/iNRBchdyw3Pys1Oog1gRdeKsfVGeM8KGpA9lgkKwY9CehcK3TqiyOjuoM34Z4j X-Received: by 2002:a63:87c2:0:b0:42b:74d2:e12c with SMTP id i185-20020a6387c2000000b0042b74d2e12cmr32848674pge.25.1662216476408; Sat, 03 Sep 2022 07:47:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662216476; cv=none; d=google.com; s=arc-20160816; b=K7qv87XrvrihWZ/ota7F4FhcYxgJLFU0qMJxvHP/suOLEGaPCdvg75kkuAwALY41z0 ULTnSQhVhfFe8OaPitIZbuAwA0LEQ70m9DaSX/kSIGUWAwLUFPhs6o3QSVZ/ZuhitLSJ pOfqDVzUyTv//WKhdHTxu2lAyfLP2+I01ikcEDepJmDnoAOWVxA/qzFy5+22xGFKYsJg 8IVkRGWheBV7raHd2/vRctQj8QEpG+sUGMnlstjj0tuNs0SQxdP2mXRwTu+NED2BKJJF kAfXhKEyn1mretoBWrH/UcQtDecvIvwfCImLMbTrRfZ8Z345sQpSMHvZM2IbQXuIoeto B1HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=yyyd1sxsmE6D0QxlQAOs5slwkgmkiRw7J9KYMdVF/nI=; b=f/yJkjRWaxGB1XNhsyQf2jncLb//Hki4je2rnJPhw5LHHznes66gys7KnHeRzpn4sh U1wyAFw0xiJatwgg5KDyNWYkH0Hzf0KAP94eiYpa52O7DF0P8Ml5eKPaCZbCh1CDuhAu UIXTD9j83IVlmErhZNfixNyiVDfUJVFWj1Q2OUfj1czgYBim/5r/2kQy4yoVHtKlv+G1 kSwBPAeY9ngnu1IbzymTtL3hmj2qwTdimo8Cb+RwAtqL9nZCcOrFZkzncGucJNyclNJy BEbE8+IpSIP2ttsSitnVhEX6nNnyNTngqGEGsSRZ+hUsdFgzohiKtEyZCYx+YZiV/aYa Gdvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=JnpaPPUz; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n13-20020a170902e54d00b0016f09d4e90esi5497381plf.294.2022.09.03.07.47.37; Sat, 03 Sep 2022 07:47:56 -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=@joelfernandes.org header.s=google header.b=JnpaPPUz; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231361AbiICOFe (ORCPT + 99 others); Sat, 3 Sep 2022 10:05:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231167AbiICOFd (ORCPT ); Sat, 3 Sep 2022 10:05:33 -0400 Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 809FD3206E for ; Sat, 3 Sep 2022 07:05:31 -0700 (PDT) Received: by mail-qt1-x82b.google.com with SMTP id a22so3425308qtw.10 for ; Sat, 03 Sep 2022 07:05:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date; bh=yyyd1sxsmE6D0QxlQAOs5slwkgmkiRw7J9KYMdVF/nI=; b=JnpaPPUzT0cPHP1fhbSh0qZ6GChZnhQyLsbs9fabP7LH+x/Azw7dkoBHbb2MYD8U0o oO4/xqx68kMJ0CIOjgvSybbK/qTOPrmaqSqvLawtFU/j4/3YnfyaaxqnE+0yndLjRpIQ lI4khU2O53b8hCY9xErCstasXwylls+KtWHlI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=yyyd1sxsmE6D0QxlQAOs5slwkgmkiRw7J9KYMdVF/nI=; b=EQM1D69uN7Ph3f2nrXYYHOaccb8gFtpo1Xx2tKJVohMaqb/8GtsLh04Cwtv07Qrss/ bzfvkI9xb8tc33NTn7oqDWb7qgkl/yYQTIsUDEeu5pjzYzPYgtixTgjxGwMtVLLKPG57 zqqAsD2F50sGzZN5JyN9Smka3pRJm++zwrhCwLnd5jzqaVpZAlqfZOxVNtcxff4op3qU 3xwiK5Z8eprI44+zSKWjFuuzQ8v02nor35T9G2w1aAGXt71DZjYqNyBbsQFvkPkEBOf1 rkT9w1bl+BHzblPNJiPupnHbXm+gpBNyg6ECg0CiGhBzNmP3q+IsKJhXvYTcGf7Ukahr BqpA== X-Gm-Message-State: ACgBeo2PuEooI4tjb0UCqhwMnsuG7Yo9Gp9WmR1fQ4PA2iQYb4yci+tY PAZ6PqKqy1jmpbEWY0EHnUF+yQ== X-Received: by 2002:ac8:5a8b:0:b0:343:7075:2129 with SMTP id c11-20020ac85a8b000000b0034370752129mr33386358qtc.393.1662213930635; Sat, 03 Sep 2022 07:05:30 -0700 (PDT) Received: from [10.0.0.40] (c-73-148-104-166.hsd1.va.comcast.net. [73.148.104.166]) by smtp.gmail.com with ESMTPSA id x19-20020ac87313000000b0034490214788sm2986718qto.49.2022.09.03.07.05.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 03 Sep 2022 07:05:29 -0700 (PDT) Message-ID: Date: Sat, 3 Sep 2022 10:05:24 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 Subject: Re: [PATCH v5 04/18] rcu: Fix late wakeup when flush of bypass cblist happens Content-Language: en-US To: paulmck@kernel.org Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org, rushikesh.s.kadam@intel.com, urezki@gmail.com, neeraj.iitr10@gmail.com, frederic@kernel.org, rostedt@goodmis.org, vineeth@bitbyteword.org, boqun.feng@gmail.com References: <20220901221720.1105021-1-joel@joelfernandes.org> <20220901221720.1105021-5-joel@joelfernandes.org> <20220903140403.GU6159@paulmck-ThinkPad-P17-Gen-1> From: Joel Fernandes In-Reply-To: <20220903140403.GU6159@paulmck-ThinkPad-P17-Gen-1> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, 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 9/3/2022 10:04 AM, Paul E. McKenney wrote: > On Thu, Sep 01, 2022 at 10:17:06PM +0000, Joel Fernandes (Google) wrote: >> When the bypass cblist gets too big or its timeout has occurred, it is >> flushed into the main cblist. However, the bypass timer is still running >> and the behavior is that it would eventually expire and wake the GP >> thread. >> >> Since we are going to use the bypass cblist for lazy CBs, do the wakeup >> soon as the flush happens. Otherwise, the lazy-timer will go off much >> later and the now-non-lazy cblist CBs can get stranded for the duration >> of the timer. >> >> This is a good thing to do anyway (regardless of this series), since it >> makes the behavior consistent with behavior of other code paths where queueing >> something into the ->cblist makes the GP kthread in a non-sleeping state >> quickly. >> >> Signed-off-by: Joel Fernandes (Google) >> --- >> kernel/rcu/tree_nocb.h | 8 +++++++- >> 1 file changed, 7 insertions(+), 1 deletion(-) >> >> diff --git a/kernel/rcu/tree_nocb.h b/kernel/rcu/tree_nocb.h >> index 0a5f0ef41484..31068dd31315 100644 >> --- a/kernel/rcu/tree_nocb.h >> +++ b/kernel/rcu/tree_nocb.h >> @@ -447,7 +447,13 @@ static bool rcu_nocb_try_bypass(struct rcu_data *rdp, struct rcu_head *rhp, >> rcu_advance_cbs_nowake(rdp->mynode, rdp); >> rdp->nocb_gp_adv_time = j; >> } >> - rcu_nocb_unlock_irqrestore(rdp, flags); >> + >> + // The flush succeeded and we moved CBs into the ->cblist. >> + // However, the bypass timer might still be running. Wakeup the >> + // GP thread by calling a helper with was_all_done set so that >> + // wake up happens (needed if main CB list was empty before). >> + __call_rcu_nocb_wake(rdp, true, flags) > > TREE01 and TREE04 gripe about the missing ";". I added it. Sorry about that, I must have messed lost the semicolon during re-basing. - Joel