Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1427715rdb; Mon, 2 Oct 2023 09:10:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHI4hNSWmAThrs3mjkDZR1XdoTqUgvKxMbZsV3zvmSzHRKfcJm4CTJ5gUodH7fIq6WN7vMa X-Received: by 2002:a05:6a00:1818:b0:690:fe13:1d28 with SMTP id y24-20020a056a00181800b00690fe131d28mr15344175pfa.33.1696263044028; Mon, 02 Oct 2023 09:10:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696263044; cv=none; d=google.com; s=arc-20160816; b=cnj/59SZdxerN1Fn50HP7pyZq718QUUfYRZ7HhVOsSaUn/H7dbK5/eZbiOP61W/2S1 SKPRKjcjMkasMnGfkghOYtFjWhQGxWUvEUYhDjr8FQSoFtZZ9IeybIhJzEa/AUg5T0Mq 4sVHFvNonjbfUZObevo9T1+Zbt536JZu9/tNUFFX0S1xqTTz6bMDVmzRE32kMBEkq5Oy VCg5Dfdd5jYfJ+hJ12NpE8BjMKpynACsVOE6ncG/qXgeyyKDmxlh03/DsLem1WPDtnzL f2ChkG6DPVjZSkTeiH5BbmYVncX/bOeJGFKE5MBVDRuWR+4CqCBTt1bfU+7FnylaNgJk GPww== 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=t0FbAr7c4aZidnaAaD7zeKERPF1dDk3aXh8kF1jGwDM=; fh=vvIxxotwr/5I3LAaua/faPKkOqW5Gug4vtwueRdQQCg=; b=RUlRZm7LwDdtjdXcdYM2I9wo7Ci30L6Ys4zvElqEkMg9ywRoPtAVWEkEUW1ZJ+hj6K GM4Kou2xzb10E8kHwhlKbZSU3rFdSnOO1B2jDcAFrILF88InuOcitmQ1DbLh3s7c20bd 6omHWTNV5vesoCy+ug29GWx1zNzF9E7cxW5+yw9DeedCkXWE0U+333Tit9ikzpxOkTkt hUgEnTsrC7N6gtrbd2FTtkKm9tZkne8Wcsq5QOF96WBEb1kUdDCLv50leceApM9fCM1J recG8AbpFzWwCNwYwtwHjM6wAntNn6AmCB3/gKfuHaKFR4jemRf91UOYTpsNO3Tpe/dM 4itw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DcyhWZjt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id fa25-20020a056a002d1900b0068fb3451deesi29525713pfb.290.2023.10.02.09.10.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 09:10:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DcyhWZjt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id 96AAE801D0CA; Mon, 2 Oct 2023 08:49:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238036AbjJBPso (ORCPT + 99 others); Mon, 2 Oct 2023 11:48:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238224AbjJBPsn (ORCPT ); Mon, 2 Oct 2023 11:48:43 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3D4BAB; Mon, 2 Oct 2023 08:48:40 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 44169C433C7; Mon, 2 Oct 2023 15:48:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696261720; bh=ELvrTTc3tgkEtVZaFMDyJF1B3XJ0+YcocBLVouLOqvY=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=DcyhWZjtp0vISG7Vld77phnuaJgizDc+s1fNzDCVZ+YYxie8riQ0udlN3ij2KHOTP 2hmsCQM+ItEeZD5zk9GuB8MyiabXCLEYjDRXoBInTb4+garra9mqaq40lhdodzO2VM Eou/to32emItUdzK0pwVvfNbmlUwCo2nOlmLMwSh5LEJBS4CBkIurT+Fw7CHp+sKTL zCp6AotjcckUL9+tkBqFjHW1v99TQjOzJ/OfC4eEds7P74FXsx79ILvQn7oDK4oEfG yV+wHBNJKn1CY4Lxyf36kzzTAlRsKhBcSEhee1xNA+gLnE/tqnUTke2gB0MNtUL7Ig 6Qednt2xWd0TQ== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id DFC70CE0CCF; Mon, 2 Oct 2023 08:48:39 -0700 (PDT) Date: Mon, 2 Oct 2023 08:48:39 -0700 From: "Paul E. McKenney" To: Frederic Weisbecker Cc: LKML , rcu , Uladzislau Rezki , Neeraj Upadhyay , Boqun Feng , Joel Fernandes Subject: Re: [PATCH 10/10] rcu: Comment why callbacks migration can't wait for CPUHP_RCUTREE_PREP Message-ID: <20c376e6-ba85-4c4a-bca6-727d3ef5e164@paulmck-laptop> Reply-To: paulmck@kernel.org References: <20230908203603.5865-1-frederic@kernel.org> <20230908203603.5865-11-frederic@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230908203603.5865-11-frederic@kernel.org> X-Spam-Status: No, score=-1.2 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 autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Mon, 02 Oct 2023 08:49:01 -0700 (PDT) On Fri, Sep 08, 2023 at 10:36:03PM +0200, Frederic Weisbecker wrote: > The callbacks migration is performed through an explicit call from > the hotplug control CPU right after the death of the target CPU and > before proceeding with the CPUHP_ teardown functions. > > This is unusual but necessary and yet uncommented. Summarize the reason > as explained in the changelog of: > > a58163d8ca2c (rcu: Migrate callbacks earlier in the CPU-offline timeline) > > Signed-off-by: Frederic Weisbecker Reviewed-by: Paul E. McKenney > --- > kernel/cpu.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/kernel/cpu.c b/kernel/cpu.c > index a41a6fff3c91..b135bb481be1 100644 > --- a/kernel/cpu.c > +++ b/kernel/cpu.c > @@ -1352,7 +1352,14 @@ static int takedown_cpu(unsigned int cpu) > cpuhp_bp_sync_dead(cpu); > > tick_cleanup_dead_cpu(cpu); > + > + /* > + * Callbacks must be re-integrated right away to the RCU state machine. > + * Otherwise an RCU callback could block a further teardown function > + * waiting for its completion. > + */ > rcutree_migrate_callbacks(cpu); > + > return 0; > } > > -- > 2.41.0 >