Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp11749748rwl; Tue, 3 Jan 2023 04:16:53 -0800 (PST) X-Google-Smtp-Source: AMrXdXv1Ne+2DCWTAkUMKbnfQacxaGlZq/9tp71rEwxQYxwNWu/ExbVWNGXOJAdCgGLTPSq9EXEU X-Received: by 2002:a17:907:a708:b0:82e:a59a:5c3e with SMTP id vw8-20020a170907a70800b0082ea59a5c3emr49214278ejc.10.1672748213084; Tue, 03 Jan 2023 04:16:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672748213; cv=none; d=google.com; s=arc-20160816; b=QWHyog2rP2DWpmhnMY8v9obLU3kEMRuAbmbnKKDBOYtq3Afk7MRBM2+zs/h9FEyYyi 6bn3qZAJgoJTRiPd2NtzUdAvmp0VVvlfAG/EUAeVBmqRVT0/9iZTkYPJJ6awDQ70VjPM 4roQ7zcApMAA5C0nAhs9YXgKzZZwCwM1duW0PLlZ/fhR3ZAUEMwRVFtGraWJaMdCWD+J KDFMZQQVf21OgoAViOr/kufNakvPbvOxFBYh8XxTUuZhKHTWQoG94Z6DAccg32EAvo1+ 5C8U0OyDqTzRP3fUKNcuykoAr4qP78pWBGEG4hfYNaVDhw3L+Pk4HI6hhWXbn5Y+xGJl QMCQ== 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:message-id:subject:cc:to:from:date:dkim-signature; bh=BDNU1M08LFjSg16sbYR8N4tyNUv6cmVRcMBK37gkkBE=; b=Dobq6Y5VwVAL8sAA/mqmJZKz+1Q3rzVZ7MzYmRZqoJFH74q2ps6SJw4FTe3EC739Gb INOMjOJtgmQVGBQ2V05zhyPaa625VlXo4YdQt7PJX17nqBxgfNKi567puU/4ullvVSnr QVLdOOfq8I/mXCkiFmdSgw/bRW7vrvT5cBz8bsdt2Nal5CXCZKenQvsVApo4VY0gRZ44 KX7kzPCGbXov1ExmGvBtXgqkziXQpwA4aU62lOOr6TMWMvPjh2hdb8v4bZ5r6nW98ma8 YiICvc9b2gRIxZb8rP/sBv/HqyKL8ynD1fvotYSxLXprU777b+BJGo2jwkYNE+l2PYxP qGUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oLllcBfp; 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 ji5-20020a170907980500b007addbdb9fbbsi29005236ejc.558.2023.01.03.04.16.38; Tue, 03 Jan 2023 04:16:53 -0800 (PST) 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=oLllcBfp; 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 S237538AbjACMOC (ORCPT + 60 others); Tue, 3 Jan 2023 07:14:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237521AbjACMOA (ORCPT ); Tue, 3 Jan 2023 07:14:00 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA8CB101CA; Tue, 3 Jan 2023 04:13:59 -0800 (PST) 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 4D26AB80EC1; Tue, 3 Jan 2023 12:13:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 69EB4C433EF; Tue, 3 Jan 2023 12:13:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672748036; bh=bzCWDaEPdr7JZjES33xBZJhsQwEVh7CU6xNE8sJYyY4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oLllcBfpPFlc0iu4AyrX4aMJ49Yp//4+xXkLkPi+223M3u/mFLWu0C/ElKDY/UNwz 4GaRGZSLYYh1In49K1tHBH/nkIhKgn2VBSrr44GHL33S/0Aqgp+bxBDBVU624NrDeV CYlju1ImB83Rsl4yn+uzAIKwz2oTTaONcdTvofbBoes+BAo2uX14E8MSJW9E15XzUc Wi0O2L8NGgj7GMK2wRkUSg7ChIAHAq2R/e3EuqgdAGPD9rJMWJfW1332RbP1XrMJB1 FHs3ePc2uBjA36Q4leeoOmgJZRkOWKZMs85zprWa2Qmf99LpE8SzbDqTEEVxmAP9tm GAA0+LXO/NfFA== Date: Tue, 3 Jan 2023 13:13:53 +0100 From: Frederic Weisbecker To: "Zhang, Qiang1" Cc: "paulmck@kernel.org" , "quic_neeraju@quicinc.com" , "joel@joelfernandes.org" , "rcu@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] rcu: Fix race in set and clear TICK_DEP_BIT_RCU_EXP bitmask Message-ID: References: <20221220112520.3596920-1-qiang1.zhang@intel.com> <20221221200849.GG4001@paulmck-ThinkPad-P17-Gen-1> <20221231182508.GB205110@lothringen> <20221231190107.GX4001@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.1 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 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 Sun, Jan 01, 2023 at 09:41:57AM +0000, Zhang, Qiang1 wrote: > > > >On Sat, Dec 31, 2022 at 07:25:08PM +0100, Frederic Weisbecker wrote: > > Yes, and I have a question, we forcing the tick dependency because the expedited grace period > is not end for the first time, this means that it is not to set the tick dependency every time. > if we set the tick dependency in rcu_exp_handler(), does this mean that every time the expedited > grace period starts the tick dependency will be set unconditionally ? > > Thoughts ? Only if rcu_exp_handler() fails to report a quiescent state. Then it means we must poll on the CPU looking for a future one. In fact the tick dependency should be set when rdp->cpu_no_qs.b.exp is set to true and cleared when rdp->cpu_no_qs.b.exp is set to false. Thanks. > > Thanks > Zqiang > > > > > Thanx, Paul