Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp747670rdb; Fri, 8 Sep 2023 15:28:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFnMuWvi/iOpUZoUc+2g43Iv0ZWKlo7OGFPLHRvk6JKa0VWjR2nyD7QE3+S/yh3MdWSDfDU X-Received: by 2002:a05:6a00:989:b0:68b:eae8:1daf with SMTP id u9-20020a056a00098900b0068beae81dafmr3556178pfg.12.1694212105722; Fri, 08 Sep 2023 15:28:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694212105; cv=none; d=google.com; s=arc-20160816; b=W6BeGBDxLqx+6SakXBznJyys6QwBxb2R9fOnoWD+6iyqVINzCcEKtz2R73K99X9UKa z4O2dLCZJN56a8K9x6jNnjJ4gOD0eD2Jz+EY1+Lidird3eP+C26dYsaFswdp4rUAw7Do 6jZ+mHWE7+r9kLeporN3dg3miBay0+tE6KT/TEnzOR8f0+90caTAx3R1G6+w5FFwibLy P+pzCaaPP0aYq341y48CK8WA972Dx6HF8+9G+q/8wmZgEkPxc0wOqgWW699Gu1N0S/Dd lV1oKFpGX1DaRVt40Bkp7tIihmPtO5X68UU982tyJE43iXfKCuoK3ebf8g9GfPCqD8bZ 1L7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=yy5UmxkIpfJd1M/aii5v5guWV9r1++Cv7FwGzLWJZU0=; fh=b/0dXqvz0kAo+07ch4KNz5dZ+JhJoOmBzkQIhQsuGPg=; b=JcZiOXxvwEb6hXa0VR6XjJMoKQ410Hw8IMGSzNhQMkCeBNiuOvQDCq7S9TMkKm1L52 o/c0fS4O3eJqQqBBDN5Wiy7P4XxVabT76Dr6h4WVw6iMrnYfVw31tslf5e2CrdlAsXP7 7ORislvlj0Cp49QrYN3RKpGsCEVCCdNmKq5Uochf6eGPYVbPuFypaXSX+2KgsR9VwxoR ZJkKa2ddF5nDZe3hJEgDyVXj7+YnnTp3Q8m1eXPPKFcsiX7CbN+FHYKJmdpJBEhvxXT7 ibqd0DtIyca8qByt2aahaV+N3XeuPP339CmG1ewocEN3xasQQeqJaQZYNXwXGBXFADzw WQ8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=n0sLQb1o; 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 n23-20020a638f17000000b00565f65e16bfsi2079885pgd.762.2023.09.08.15.28.11; Fri, 08 Sep 2023 15:28:25 -0700 (PDT) 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=n0sLQb1o; 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 S1344535AbjIHUhB (ORCPT + 99 others); Fri, 8 Sep 2023 16:37:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236159AbjIHUhA (ORCPT ); Fri, 8 Sep 2023 16:37:00 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80B71E65; Fri, 8 Sep 2023 13:36:38 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF15FC433CC; Fri, 8 Sep 2023 20:36:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694205397; bh=Myb0x4KbAYJfwZIc0cipS2HFSdskG2s5T9FsIJvmid8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n0sLQb1ovYq4ry65mQo6nbCRm0BjIK14Q2Y2YTtP6N/G9GgJYl8Prsmdnw+BDxezF Suqz6NvTkljdrVQtGPL8+4AfFKJXj8JkWH2EKQSP3VrWg8X/MEx/RF/Kr8qn3IHOph xktc8JtPLSuSDv9HSn3VpgfpKVkyekrfBMUlFL8eCi2MXlBXisR3d7r2jwOUdolRd+ e6irVd/fD8CK/MYu3uyV7sX9ofnl6AWI0WpzEI1ydA3ScvxKGBA7LAvzy2osae359i G8YDLc+OkrB8xt9vsPXMtjdTWF/vTZNg7kIBPM4xwn5k9frlEm5V80/6/0k4bThKf6 6nzjFgjkIwhVw== From: Frederic Weisbecker To: "Paul E . McKenney" Cc: LKML , Frederic Weisbecker , rcu , Uladzislau Rezki , Neeraj Upadhyay , Boqun Feng , Joel Fernandes Subject: [PATCH 10/10] rcu: Comment why callbacks migration can't wait for CPUHP_RCUTREE_PREP Date: Fri, 8 Sep 2023 22:36:03 +0200 Message-ID: <20230908203603.5865-11-frederic@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230908203603.5865-1-frederic@kernel.org> References: <20230908203603.5865-1-frederic@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 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 --- 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