From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BE03F3B47D3 for ; Mon, 15 Jun 2026 07:00:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781506814; cv=none; b=TLMDm814+RltWXWmsJdmKVV2evrqLsfT3jdG1TTCagEiu2buvIBupkT71JZA9cw0nci+syD4BNUDJyoFRDhKhBq/jHMwd1UncqjPo+zwUvJZXVoW3JO0nv1XNgpaz2m9nJcSIfWp3gTVJoaA+z497fS0BzPkiysiS94ywYTyuV4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781506814; c=relaxed/simple; bh=gn2ssXC1ejqemrvTuLo38/1m205JY8o5WvjCLUAl4Mo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=pv9RIvbQAdDPA9L2umxWNv5UpuojvLHIkDkbVExk5WJCCcm1L8vbk3WAmsxpbvx3H+fvdj877yORXKgsPYr/YKrcktR9Bb55hCW7Yv6SXUZqOhG0nc1kkE9lwz4UgVvKzYojQZ2SQ0e6mZaGXZsoEiXtrc0Goq3ol0sDRX4j22I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=HCd2ju4M; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HCd2ju4M" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-490b613a17bso25814445e9.3 for ; Mon, 15 Jun 2026 00:00:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781506811; x=1782111611; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=f8w8xq/4mVkW1zPaq+z+yq8eteQWjYrXoGXcozsWmpc=; b=HCd2ju4MSe05WVZ7QBJNvt1sn29Aw6eWWAmH2k7qUC+bQYb53gEtEvEuOcKaLZWlOe JfWmgb4NJxLA61916hpTSFWc1qCtvZS5R8/CQj0sduFSSEuO0WDdAKjBRAW7MtYINEY6 0VVSGKZh6nYlij46mLLDeCIADSt15jRSr4lCh9YquPVJVROsdEKaJnuO43vS/fO337PM Gm7nhL3xFAlBYllxgAE2HVJlQCHEjEIis5IS6b/URCgq0cDARar9J4tBcQIORFBSCt8d 6m1CmNzUk9v5i37gDwRZh18jtyuMmwJNVfEyHAQx46/pE41EyYyoa+t59/lnwY9UacTo GTqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781506811; x=1782111611; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=f8w8xq/4mVkW1zPaq+z+yq8eteQWjYrXoGXcozsWmpc=; b=GGWueLsrV1PJAgWu9/MdqSV+oFsSCC16pRx3ffDsZMUwu0byrTdLPvVb6d8RoraSSr h6j17VL7Rd7RQK2p69JYlbW1laAdvJdtSfSuNwGKXUzchUuh/8l0o12c6BXQ1FeA3DnK 4HuxcfOW0WsobR6a1Prr/yEcDWK0q/BLQry5pGZxJT/k02lXcFIs17FbnzXr6BLZScT3 il43o2tp9gfe/nnCeEcHr8smJa9O6SEqIF2XLZAivbogIug9RL+Aro9StLGd9pLiZ/u3 5a/hMM9CLJ7SLoNCAW6b2kp5pRICUnLPPm7AMJ0U4wg4IzYiZDfdLBC1sAo20VdJLe8O QypQ== X-Forwarded-Encrypted: i=1; AFNElJ+Nxxt7OEE6xpiLJXw9ybAwCGCue7rLZ1I+AXS80B8IsDY5TvGmoqFruJp4lB6WtTMqxSXYYkV/eUmBneA=@vger.kernel.org X-Gm-Message-State: AOJu0YyM1KsJ4Fv9rfRNV8Jo6e2cyc5PsIJwrq74ogEcwi5GxfS0tK0B XJgJ9iAYb9MN6peYxE/mtx9elsKXPcSkfyanKFoeGRQjrb1h/x/XZATW X-Gm-Gg: Acq92OGdbYbvXTmIuH3P/IFkBoHAmxdVVG/3mMIx84mTrKm4iILIbkZSaAs/+txXIhE gQ8HTqXU5hxYBRCn+sgKKF22YleWwdbInwsCuOsbnnI//rvjBsMEIM/zNmTwhqdrtbMQiRWnA2r mBcPc0GC/tO32dhRh83kVjlXD0AsWnyU5FMK7QpPo1fua7NcuBfvxOy1fnlvvVzRwZUFir6CjVZ ttEj4uH2NIX22ub3n4lAZ5Bs6J9FP5OB+gsKbLWfpR+0wHUnCC4IOOUg9ooIesmxugNgqz3qKFX XSB7c1hEUVKtusc0L1Pi4rvHNRcD905h5fcZ0n3IP0TsXnnKQrkJVnQC5ivJ7Kg9sx5Ptv9pJGm +7rLdmTNo3lL5U7iTWd6PLQHTj3b6aAai903VJC+maHi+hmZPtRdItVgu2X8GSp/tClX6ghyUVM aFkgljx+yLlWpi05fHVvIl3byWWyPwTGuQZsfNppj7dY3dOnH97HGturPy93hi6Lq28gNpsiar1 RVMLsw3JS6p42s+k0vcZnlfiw== X-Received: by 2002:a05:600d:6447:10b0:490:e18f:d108 with SMTP id 5b1f17b1804b1-490ec501b2cmr122824265e9.19.1781506810190; Mon, 15 Jun 2026 00:00:10 -0700 (PDT) Received: from ?IPV6:2001:9e8:f12e:9401:c875:96a4:7b6f:72fd? ([2001:9e8:f12e:9401:c875:96a4:7b6f:72fd]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ea4a399fsm217664565e9.0.2026.06.15.00.00.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 15 Jun 2026 00:00:09 -0700 (PDT) Message-ID: <731bd6c4-0f70-45a2-8480-8fed315b82b4@gmail.com> Date: Mon, 15 Jun 2026 09:00:08 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] MIPS: smp: report dying CPU to RCU in stop_this_cpu() Content-Language: en-US To: Huacai Chen Cc: Thomas Bogendoerfer , linux-mips@vger.kernel.org, Sebastian Andrzej Siewior , Clark Williams , Steven Rostedt , Thomas Gleixner , Jiayuan Chen , linux-rt-devel@lists.linux.dev, linux-kernel@vger.kernel.org, stable@vger.kernel.org References: <20260608093729.12111-1-jelonek.jonas@gmail.com> From: Jonas Jelonek In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi Huacai, sorry for the reply delay. On 10.06.26 08:05, Huacai Chen wrote: > [...] > In theory LoongArch has the same problem, but I cannot reproduce, > should I enable PREEMPT_RT? Or there are some special configurations? Sadly I cannot help with that. For MIPS, this seems to be the default behavior. > Huacai > >> This issue was noticed on several Realtek MIPS switch SoCs (MIPS >> interAptiv) and came up during kernel bump downstream in OpenWrt from >> 6.18.33 to 6.18.34, after the backport of the patch to the 6.18 stable >> branch. The patch also has been backported all the way back to 6.1. >> >> Call rcutree_report_cpu_dead() once interrupts are disabled, mirroring the >> generic CPU-hotplug offline path, so RCU stops waiting on the parked CPUs >> and grace periods can still complete. MIPS shuts down all CPUs here >> without going through the CPU-hotplug mechanism, so this report is not >> otherwise issued. Reporting a dying CPU to RCU outside the regular hotplug >> offline path is not unprecedented: arm64 does the same in cpu_die_early(). >> There it is an exception for a CPU that was coming online and is aborting >> bringup, rather than the default shutdown action as on MIPS. >> >> Fixes: 91840be8f710 ("irq_work: Fix use-after-free in irq_work_single() on PREEMPT_RT") >> CC: stable@vger.kernel.org >> Signed-off-by: Jonas Jelonek >> >> diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c >> index 4868e79f3b30..0f28b4a62e72 100644 >> --- a/arch/mips/kernel/smp.c >> +++ b/arch/mips/kernel/smp.c >> @@ -20,6 +20,7 @@ >> #include >> #include >> #include >> +#include >> #include >> #include >> #include >> @@ -422,6 +423,7 @@ static void stop_this_cpu(void *dummy) >> set_cpu_online(smp_processor_id(), false); >> calculate_cpu_foreign_map(); >> local_irq_disable(); >> + rcutree_report_cpu_dead(); >> while (1); >> } >> >> -- >> 2.51.0 >> >> Best, Jonas