From: Sasha Levin Subject: [PATCH AUTOSEL 5.13 06/11] alpha: Send stop IPI to send to online CPUs Date: Tue, 3 Aug 2021 07:43:47 -0400 Message-ID: <20210803114352.2252544-6-sashal@kernel.org> References: <20210803114352.2252544-1-sashal@kernel.org> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627991041; bh=6pfrQY5QyDEqVrt2lMWcXkE5SO4dTw+z8f67Irfj2EA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YEr9jvmO+7E2Ebr2V8DvCRecmRUzzC7R2zsMLWwgWMoHkDXhiYD1pLjrm43ICVwH5 Bb5TsXT8esYg7r8K4vrMqJxq1wPEw55qO3uHQ4RtsAG66u0kn15eElEXYfLcgVLg8p dUorztjtLzjM2KxBIkDWlOr7ZfzLnHjmdVELLjLuCMNhU5bh4hlmCpw7kEFbqeM2OK V8FNr7wucWZIT/IJo2yVGlgAsuD3I9PCAB93PCBatDkB7mTZ1Y2E5kMTh//U0pKfG0 k3WK2yOZqgP64mAIbqvuChKbUTNGxi3jOwDIMfCP/ANKLpsQG/nXlV3jH5ulJdH6EL HdINAhV5NqeOg== In-Reply-To: <20210803114352.2252544-1-sashal@kernel.org> List-ID: Content-Type: text/plain; charset="us-ascii" To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Prarit Bhargava , Richard Henderson , Ivan Kokshaysky , Matt Turner , Sasha Levin , linux-alpha@vger.kernel.org From: Prarit Bhargava [ Upstream commit caace6ca4e06f09413fb8f8a63319594cfb7d47d ] This issue was noticed while debugging a shutdown issue where some secondary CPUs are not being shutdown correctly. A fix for that [1] requires that secondary cpus be offlined using the cpu_online_mask so that the stop operation is a no-op if CPU HOTPLUG is disabled. I, like the author in [1] looked at the architectures and found that alpha is one of two architectures that executes smp_send_stop() on all possible CPUs. On alpha, smp_send_stop() sends an IPI to all possible CPUs but only needs to send them to online CPUs. Send the stop IPI to only the online CPUs. [1] https://lkml.org/lkml/2020/1/10/250 Signed-off-by: Prarit Bhargava Cc: Richard Henderson Cc: Ivan Kokshaysky Signed-off-by: Matt Turner Signed-off-by: Sasha Levin --- arch/alpha/kernel/smp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c index 4b2575f936d4..cb64e4797d2a 100644 --- a/arch/alpha/kernel/smp.c +++ b/arch/alpha/kernel/smp.c @@ -582,7 +582,7 @@ void smp_send_stop(void) { cpumask_t to_whom; - cpumask_copy(&to_whom, cpu_possible_mask); + cpumask_copy(&to_whom, cpu_online_mask); cpumask_clear_cpu(smp_processor_id(), &to_whom); #ifdef DEBUG_IPI_MSG if (hard_smp_processor_id() != boot_cpu_id) -- 2.30.2