Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp960486rdb; Wed, 1 Nov 2023 07:39:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF9unPSkav8oXY2inueM0vLWtq12xvkjPDhcmB9iUWPqJwwQaymgM2ijoSITprgyUIS/fmJ X-Received: by 2002:a92:cd88:0:b0:350:f956:91c4 with SMTP id r8-20020a92cd88000000b00350f95691c4mr20009383ilb.4.1698849580919; Wed, 01 Nov 2023 07:39:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698849580; cv=none; d=google.com; s=arc-20160816; b=eF0vissh3oz0rCHxG1pyj/vgo/iDX2KsLxab38fO359ra5rJddKSzIxtRXRLQJsuC0 qpdF5HRqQfDs/w9nmPcO8EfsnAfR4eI+jvbIAz3kDtR2axYgnoYtZoVsYXLUdfUuK8lB yIGoR2nwQUw6YJijOZF0VanM5jbBQ9tEDoo287GCmoFh/nNrKSINi5wH84hzONHMhgxh 906pB/wQYSkc8KgFUFGsN8loFKtPpYXyUpoEn5efFGqDBpOXXxAlQ+w3lZwd3PN3vkNz ZKkbHqXbgxqQylUqaIDZhx4JoaOT1u37Z91WyUuukSZuwmsD9UcUCTDKtM+IYW2Y3bSN 5z2g== 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=VYAYOAUM0f21UoZopL6UQoz3bQ50cgRdV9XxeLOz8Kw=; fh=s6kQHJw+u+rlwbAiw+1c2g+llFg65ofm+KCWCANjYA8=; b=MQHnt1BjTjpDcTwhhswW87gbwRP9f325J3q7Fz/es3PB2bEJVG1x4wCnLIs2lCUt0p TcdQmZVbzQLJ5qgCOP+ap9PWv6zpMRcnmJ9LLZHxSdm6+JX+Pi7IQekTxY5VOHverlZH Hoao9JVZ8IkyI/kLDEU1Pi6vpTHeVGSfFMiDpndZA98rLLprn4GC8X/23kR1CWxjFOuQ mlJKvsPU3cqlSB7aH5EH9BVjGH/bGBW4GYgY7Js1DsDMG4UHzVqfmxWsMh16YUq+r39a Ob27T0mxkkP9nAosi4i+rvB2NHpbBh3xQD/XSlDt9nqFu0Te0KOEsI1czNA2APT5gEFg vPag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=hehd9o16; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id by26-20020a056a02059a00b005b9305bfbd1si3471836pgb.742.2023.11.01.07.39.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 07:39:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=hehd9o16; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 8445780A87F9; Wed, 1 Nov 2023 07:39:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344444AbjKAOiy (ORCPT + 99 others); Wed, 1 Nov 2023 10:38:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233678AbjKAOix (ORCPT ); Wed, 1 Nov 2023 10:38:53 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0086383 for ; Wed, 1 Nov 2023 07:38:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=VYAYOAUM0f21UoZopL6UQoz3bQ50cgRdV9XxeLOz8Kw=; b=hehd9o16JJHfFnyJYCBD7eG3MX 62Z2O5bsjEs5fH0g4E19XeCTTpdzjws4YKIs2MIkr8vqptkDDuD0FOmJp4rO/qdx7xzQdTNjcPwpi FUmTFX6updIbhrC9WHDP2A6mfoDkYvkvdIeXrkYIWQ7l3fMEC2Dnja/OZwyBYFiDKZorc0p/PFbQY eOQ8HxzYe+xcOz9Cog1LXvTLwnbhasdQGumDQIehVc2+dYg1NMgvm36CL3AWxIBu/dzS5DqpU82nZ 1Gu+yqh9hem6QgIOc2odGKGhG7OeDKsMH42E88IPqoqMzpOgEsSsx7qy33n/p3J1/7QNRFzGwFC9B PmUono5g==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qyCMJ-005lTq-0Q; Wed, 01 Nov 2023 14:38:15 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id C252F3002AF; Wed, 1 Nov 2023 15:38:14 +0100 (CET) Date: Wed, 1 Nov 2023 15:38:14 +0100 From: Peter Zijlstra To: Z qiang Cc: "Paul E. McKenney" , Waiman Long , Ingo Molnar , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , linux-kernel@vger.kernel.org, Phil Auld , kernel test robot , aubrey.li@linux.intel.com, yu.c.chen@intel.com, frederic@kernel.org, quic_neeraju@quicinc.com, joel@joelfernandes.org, josh@joshtriplett.org, boqun.feng@gmail.com, mathieu.desnoyers@efficios.com, jiangshanlai@gmail.com Subject: Re: [PATCH] rcu: Break rcu_node_0 --> &rq->__lock order Message-ID: <20231101143814.GL15024@noisy.programming.kicks-ass.net> References: <20231031001418.274187-1-longman@redhat.com> <20231031085308.GB35651@noisy.programming.kicks-ass.net> <20231031200228.GG15024@noisy.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 01 Nov 2023 07:39:26 -0700 (PDT) On Wed, Nov 01, 2023 at 07:21:09PM +0800, Z qiang wrote: > > static int rcu_implicit_dynticks_qs(struct rcu_data *rdp) > > { > > unsigned long jtsq; > > + int ret = 0; > > struct rcu_node *rnp = rdp->mynode; > > > > /* > > @@ -847,8 +852,8 @@ static int rcu_implicit_dynticks_qs(stru > > (time_after(jiffies, READ_ONCE(rdp->last_fqs_resched) + jtsq * 3) || > > rcu_state.cbovld)) { > > WRITE_ONCE(rdp->rcu_urgent_qs, true); > > - resched_cpu(rdp->cpu); > > WRITE_ONCE(rdp->last_fqs_resched, jiffies); > > + ret = -1; > > } > > > > > Maybe some modifications are missing here: > > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c > index aa4c808978b8..77e7a0dc722a 100644 > --- a/kernel/rcu/tree.c > +++ b/kernel/rcu/tree.c > @@ -867,8 +867,8 @@ static int rcu_implicit_dynticks_qs(struct rcu_data *rdp) > if (time_after(jiffies, rcu_state.jiffies_resched)) { > if (time_after(jiffies, > READ_ONCE(rdp->last_fqs_resched) + jtsq)) { > - resched_cpu(rdp->cpu); > WRITE_ONCE(rdp->last_fqs_resched, jiffies); > + ret = -1; > } > if (IS_ENABLED(CONFIG_IRQ_WORK) && > !rdp->rcu_iw_pending && rdp->rcu_iw_gp_seq != rnp->gp_seq && > > Bah, you're quite right, I missed that there were two sites calling resched_cpu(). Paul, do you want a fixed up version or will you fold in the fix?