Received: by 2002:a05:7412:8598:b0:f9:33c2:5753 with SMTP id n24csp278981rdh; Mon, 18 Dec 2023 20:45:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IG487rwLq3BlocM1JFETIQwfghUdaHqVtH0YYLopuSwYnmh+kvPM3CaxGoYc/Y/xlNYI70A X-Received: by 2002:a17:907:948f:b0:a01:e916:3590 with SMTP id dm15-20020a170907948f00b00a01e9163590mr9472170ejc.75.1702961136051; Mon, 18 Dec 2023 20:45:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702961136; cv=none; d=google.com; s=arc-20160816; b=0u4k1/UDkgwJ12NgF6a7aUl8FJxBJBUHo6G2Z4DwfRH/YCq+j9255h/Z+nukSnGP+b 8iCqKv1kNu7mRJoNaV9znQHJxmy1z8/qy8ZIitj6r1lwc+lNySOmbwVwM4/t2j5OD49/ KyJijJNV6bjZ0V2GwnkLvZajQ9Iws6AgY7/QxxruFbPq1Q+g6kOkactAz6px6OC6XRGA 3QpwI2CEx96qBu4NOHmzOuLBMqH7ASdqEWTj3NAzqrJYNsRrnYJBMGAdTknrDBp4blS/ ACZA9klgPMuQI2oVO4s1wmRmBq0WRZojIUj3gI72tO7cJBlqqxFYIFedaEqAn/j/9qmI f1cA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=bEOM25w6ZHGOo8xz3pUkbwoXF3nJT8Weog/HCl0yXGg=; fh=7fUhCfRDzNX5PGMlKgLp+hBqDlClNjKWgPM38g1YRVQ=; b=v0OFDNrK1p4xzb47vQyB4jy7arA4D6YVUmzR7A3RV3a+4pXaCHnXVkkdY41A5jKQNr V3x6gBojvzB1Z2sPKZqBXcudZHJgb8BrvCehqewV3xddz82dpaHv53i46NHrH21Wn9UI KCJO1IeOu2QPyI0bAiQbKbXkDh6Ho/1/wGnT5/1IKV6fUmbloy2DsOu9dt1Lf4imG4vl Ln+Rh9dA99rTYAOF+hGgWDgS0k2FVp3B3wECl9Swuf2Usx5W2+2M5Amez1PuRDGcyWsk Z3kKtR9BL4m95q9oZTmQl0y1QGm7CuyOslhxZTjS//UReA2CMne5nJF4N/X19MlOA1mZ CFkw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-4693-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4693-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id mj23-20020a170906af9700b00a2374f246aesi299222ejb.755.2023.12.18.20.45.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 20:45:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4693-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-4693-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4693-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id CCEC21F249F3 for ; Tue, 19 Dec 2023 04:45:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4499B79F5; Tue, 19 Dec 2023 04:45:28 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from mail115-118.sinamail.sina.com.cn (mail115-118.sinamail.sina.com.cn [218.30.115.118]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 52BAC79C2 for ; Tue, 19 Dec 2023 04:45:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sina.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sina.com X-SMAIL-HELO: localhost.localdomain Received: from unknown (HELO localhost.localdomain)([113.88.50.253]) by sina.com (172.16.235.25) with ESMTP id 65811F4F000065A6; Tue, 19 Dec 2023 12:42:57 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com Authentication-Results: sina.com; spf=none smtp.mailfrom=hdanton@sina.com; dkim=none header.i=none; dmarc=none action=none header.from=hdanton@sina.com X-SMAIL-MID: 62226334210294 X-SMAIL-UIID: 94D3518CDBBD49DC8BA30D3158000DA7-20231219-124257-1 From: Hillf Danton To: Frederic Weisbecker Cc: LKML , Boqun Feng , Joel Fernandes , Neeraj Upadhyay , Uladzislau Rezki , "Paul E . McKenney" , Thomas Gleixner , Peter Zijlstra Subject: Re: [PATCH 2/3] rcu: Defer RCU kthreads wakeup when CPU is dying Date: Tue, 19 Dec 2023 12:42:47 +0800 Message-Id: <20231219044247.1708-1-hdanton@sina.com> In-Reply-To: <20231218231916.11719-3-frederic@kernel.org> References: <20231218231916.11719-1-frederic@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Tue, 19 Dec 2023 00:19:15 +0100 Frederic Weisbecker > +static void swake_up_one_online(struct swait_queue_head *wqh) > +{ > + int cpu = get_cpu(); > + > + /* > + * If called from rcutree_report_cpu_starting(), wake up > + * is dangerous that late in the CPU-down hotplug process. The > + * scheduler might queue an ignored hrtimer. Defer the wake up > + * to an online CPU instead. > + */ But why is scheduler having any interest selecting a dying CPU for adding a hrtimer on at the first place? > + if (unlikely(cpu_is_offline(cpu))) { > + int target; > + > + target = cpumask_any_and(housekeeping_cpumask(HK_TYPE_RCU), > + cpu_online_mask); > + > + smp_call_function_single(target, swake_up_one_online_ipi, > + wqh, 0); > + put_cpu(); > + } else { > + put_cpu(); > + swake_up_one(wqh); > + } > +}