Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp940621iob; Fri, 13 May 2022 17:11:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZbd7wxjiiCR53PFxhulox6sxZXORwOLNHwRPXHwBOBVULOzoOP/ynfKyhOzNcHVq/t9RH X-Received: by 2002:a05:600c:4fd3:b0:394:7fa6:2584 with SMTP id o19-20020a05600c4fd300b003947fa62584mr6697740wmq.177.1652487067564; Fri, 13 May 2022 17:11:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652487067; cv=none; d=google.com; s=arc-20160816; b=Hnfk5As9l125ZLLmTXWXzNBIIH+vX08P99Vc6EXcN/haDlO1zjARxKDiO2WQ+t3CxX jesoPVw6R+TGeyANS2sUHeLzXrmBw5toI0VL+hp/biUXcavrojZT4cbHdNqsy4A6DIiH bdOejghaZPrzK3R1pfkaBiHvWHX5mk3OQidPdgdmXnopwGf/1m2nxZYGC4zzv+e1/Cw1 cmcll0EMTvUHy2IQUaa4PzzLNBsSxtLd9/iaqwkQIViY7z2zPF4Enw2i+aBU8ivvqZwA c/MNKWe3AlwVqDz2B8nfY2WcMdWqQ4m2lyNhxRqIywnHUQycmZnLpMHvyVaPqvjtscC7 cm8g== 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=mjmLUFTN72tmk/WZNa1ikg3W+/y+3wTZTqQm9hXDYE8=; b=uGPMLPdg6pPLXOw3JfrzcIq3UtP5DRT5Rl+rQ8EkAiNyWZhqKvix95HBQ9qKtH+R1Z JlbS7DKyumrrkmVVJdpizxKFlZdDmTyXWqRnXXGFhQEHsOoK/gpFt/hqL607zv2WOtFy KSnWE3Y2IjOn++GE6pVUPd/XcWQ7UR8bT4MkV9oiJT2W5FliJ+3yv/2S4QRKflpRLMM2 v9CTn6ehF2VO71UhqQqUx89IkxkVLhe0LPJrJPiW4NVrzU3eGqbNftfIjFJLRuzvxWgq a9Gyp2E31JBORNMeCfm9viTjAQXyh5Cqa4KqK/LrX6hjjdIeYCf2BB64KtMAo+s87wKC 7/aA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kfuZsA31; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id 184-20020a1c19c1000000b00394803e574asi6784675wmz.5.2022.05.13.17.11.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 17:11:07 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kfuZsA31; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5BD732F9362; Fri, 13 May 2022 16:12:39 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376289AbiEMBG5 (ORCPT + 99 others); Thu, 12 May 2022 21:06:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376288AbiEMBGz (ORCPT ); Thu, 12 May 2022 21:06:55 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37E3B4B85E; Thu, 12 May 2022 18:06:54 -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 ams.source.kernel.org (Postfix) with ESMTPS id B82FBB82C27; Fri, 13 May 2022 01:06:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 79DB9C385B8; Fri, 13 May 2022 01:06:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652404011; bh=FoLn8p1rIVJzm+8vcP0quDOYymFUzJqV3NNi2X/rVrs=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=kfuZsA31u11/Vyux9BRFnyit1LtRGc4TxvfPzig1UxTU+72HPJKNPkVIkipU6bXDM wL3QN7qusSN/bJSFw6SNywcVsyA8DtyQfrY7acuTINBCzQjpXPRTsOUIBUJqvTjCgg pHeUv7BY4jHnuPkD2yyi1azZ1Ftst+fMygPFqC1kEsBGs8zLW5CdP1f9F6dDk7Dfxz cfIaj7X087uil9VSm9h9DiDCRNQLvBWPQ3GyyIU496DNem3SStImIxFRR+njaMXvkD DeAHNPfUlgF3lWr4wax2oFJAfFhbf4jDgRp+TBXJw4H/rwLzxLBskg1dOc9eaVi196 +pcHUG7uNJhzQ== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 18CAC5C051B; Thu, 12 May 2022 18:06:51 -0700 (PDT) Date: Thu, 12 May 2022 18:06:51 -0700 From: "Paul E. McKenney" To: Zqiang Cc: frederic@kernel.org, rcu@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] rcu: Direct boosting gp_tasks for strict grace periods Message-ID: <20220513010651.GD1790663@paulmck-ThinkPad-P17-Gen-1> Reply-To: paulmck@kernel.org References: <20220513004256.465233-1-qiang1.zhang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220513004256.465233-1-qiang1.zhang@intel.com> X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Fri, May 13, 2022 at 08:42:55AM +0800, Zqiang wrote: > If the CONFIG_RCU_STRICT_GRACE_PERIOD option is enabled, the normal grace > period will be treated as expedited grace period, the gp_tasks that block > current grace period needs to be boosted unconditionally, therefore this > commit adds Kconfig check in rcu_initiate_boost(). > > Signed-off-by: Zqiang Good eyes! I have queued this for further review and testing, thank you! What sorts of tests did you run on it? As usual, I could not resist the urge to wordsmith, so could you please check the version shown below? Thanx, Paul ------------------------------------------------------------------------ commit 079e0f894c5d887c678f94332c1fa7287abfd6bc Author: Zqiang Date: Fri May 13 08:42:55 2022 +0800 rcu: Immediately boost preempted readers for strict grace periods The intent of the CONFIG_RCU_STRICT_GRACE_PERIOD Konfig option is to cause normal grace periods to complete quickly in order to better catch errors resulting from improperly leaking pointers from RCU read-side critical sections. However, kernels built with this option enabled still wait for some hundreds of milliseconds before boosting RCU readers that have been preempted within their current critical section. The value of this delay is set by the CONFIG_RCU_BOOST_DELAY Kconfig option, which defaults to 500 milliseconds. This commit therefore causes kernels build with strict grace periods to ignore CONFIG_RCU_BOOST_DELAY. This causes rcu_initiate_boost() to start boosting immediately after all CPUs on a given leaf rcu_node structure have passed through their quiescent states. Signed-off-by: Zqiang Signed-off-by: Paul E. McKenney diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h index 99cde4c947699..b4ab952f04ea6 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h @@ -1159,7 +1159,8 @@ static void rcu_initiate_boost(struct rcu_node *rnp, unsigned long flags) (rnp->gp_tasks != NULL && rnp->boost_tasks == NULL && rnp->qsmask == 0 && - (!time_after(rnp->boost_time, jiffies) || rcu_state.cbovld))) { + (!time_after(rnp->boost_time, jiffies) || rcu_state.cbovld || + IS_ENABLED(CONFIG_RCU_STRICT_GRACE_PERIOD)))) { if (rnp->exp_tasks == NULL) WRITE_ONCE(rnp->boost_tasks, rnp->gp_tasks); raw_spin_unlock_irqrestore_rcu_node(rnp, flags);