Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp1048965rdb; Wed, 1 Nov 2023 09:52:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEoVkkPk0X/V2WHRe5hH9OmlpbGz72ul58xQlJYHXT+Tue6tQoYQzmwwe7x46OFt263sMVu X-Received: by 2002:a05:6870:2b05:b0:1ef:b588:94b5 with SMTP id ld5-20020a0568702b0500b001efb58894b5mr15480927oab.27.1698857539476; Wed, 01 Nov 2023 09:52:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698857539; cv=none; d=google.com; s=arc-20160816; b=uqOBuLYmM1nu9GM5aqfXFsx9xjbkeaquw0ZZ08l99Tj3p+baMfzNTZhjbBFTlAqU/O dE2rHSsmzrb27DIIsLm0sISQFJiP6Ucr8k1kKyBse3073HmNWMIGpM6//LVm/zDJG+HE cr4zpnmaYc7fgpH7fnJ8jfcMRIbOlTRdVIHgLgPfWk7KIaJ4uyBVzSbrt32OGgroEiyO FamzPPXCMFVFJsPr55h46bchzDdImVxsYrPo/+LUdfzuwwxpGjKH4cmzQO7f4C6stjVE ZTduT5oP8Zn2tDYPLMRV0yv6lYzK3Mu+cAAqt29PoJsruaPizE8aazpUTpucYQOGBsQE Ue6Q== 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=RbmH7xIj8C1EnHTQkDaKqCb22fYOSEhgyu5vYDnlZCM=; fh=35pJdCeBpaPRe6xX70GpePEH5k9wHNsFjWo5+yUz/pw=; b=M41UbgU1qFaFK24aS7UllwKYgBpNgZMa9fumtjtLXEvVH14rihL0JLxo+gxn/3aTA3 gRPoHV+IPFsFw3Plz1wmaY1iOJrIPmXEZgVVGNKf3XbF+5K9qKOgDwRpplo4T+TQQCxR qqbN9erVNIzaxe9kOEihIo94icU4s6CslWGeATnoHzbOAq4jnJWxyJVp0jmoxE9QPI0i 0GSiyBt9VImXgPCsX4Gut9QkxRKsYe00AO8OWZUTxzdJrC1I8GZKqmMqK4DdDW15Z+WQ S4sa6U6i6SqvdCfSOD9QNn2VwFubtYWMIOxUFhOYwE/kDJboci3mPe2AkX6mp1ANpt13 wk+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Dv5heqTE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id ca33-20020a056a0206a100b00585a5433e55si297351pgb.143.2023.11.01.09.52.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 09:52:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Dv5heqTE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 915FC802E83D; Wed, 1 Nov 2023 09:52:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344229AbjKAQwJ (ORCPT + 99 others); Wed, 1 Nov 2023 12:52:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231233AbjKAQwI (ORCPT ); Wed, 1 Nov 2023 12:52:08 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81EDEFD for ; Wed, 1 Nov 2023 09:52:06 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1A8E3C433C8; Wed, 1 Nov 2023 16:52:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698857526; bh=37fVDxsD1+ndH1KEv7ub60E4WjDu9EIb5gu6BqidoUk=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=Dv5heqTElz4Np+THPwEwudsnZwZSqzUNhq/tXu0yVGRESGMKuj4YnVuMSIOEzpOoG yBO9GF5FWtXKx3mCyMAr4sHXZ1ydAnUuD+sZGgXp2rNS6dtAVJz+SEUWZm0Hej2O9N 9Zq0JoX53w/QYj7R4kzsEPWrcbfRXnRYslGPLORZh6Oo6/b6V//kyZgTvQSV5YnABn Etlb2ZG/2CdOCdryc3SSNdzn7DR1IFhLym/NVeVlbBPwOOlxSe+rx2kbOskVDrCdd/ +bxRwk5Ga2QRN9bEOmzPjYXmYLHwh2Wz3lyHU7XCa55nv4lk+fPcASiYQ6tN4aAgQR qI6ukAU1hluxQ== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id A12B4CE09BE; Wed, 1 Nov 2023 09:52:05 -0700 (PDT) Date: Wed, 1 Nov 2023 09:52:05 -0700 From: "Paul E. McKenney" To: Peter Zijlstra Cc: Z qiang , 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: <827b1dbc-beff-4b81-a90e-3bcc7c3b3a30@paulmck-laptop> Reply-To: paulmck@kernel.org References: <20231031001418.274187-1-longman@redhat.com> <20231031085308.GB35651@noisy.programming.kicks-ass.net> <20231031200228.GG15024@noisy.programming.kicks-ass.net> <20231101143814.GL15024@noisy.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231101143814.GL15024@noisy.programming.kicks-ass.net> X-Spam-Status: No, score=-1.6 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,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 fry.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 (fry.vger.email [0.0.0.0]); Wed, 01 Nov 2023 09:52:16 -0700 (PDT) On Wed, Nov 01, 2023 at 03:38:14PM +0100, Peter Zijlstra wrote: > 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? I can fold it in. I also clearly need to add a 15-second stall to at least one of the rcutorture scenarios to exercise this code path... (And Frederic might be pushing this one, his choice.) Thanx, Paul