From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 42FD230148A for ; Thu, 21 May 2026 15:27:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779377222; cv=none; b=FjRPh6TXYHgeBEHXDuNcBpyaU2SWZJ5pMgfisFJz0JKY5dHnOXHGbPQ7JBbUUwszAa9REf05kO1nfBAz5nazAeBU0voWeiLZi8lG0DCjuYVCIsR1/HJ8iqkOyusdZeH34llTzWdXTxyYhynJ6dydBp0oXzonaP2OHv56pIgV58Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779377222; c=relaxed/simple; bh=D5hGMVUSNh6sGvUyjr9cAnmj0O/VJEzRx50TQDeJ36o=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=jsH/s3xjJgyoM1/0UdDT5JRaHaaMjJ/Gr/JVOr4LYtQ0SPH2MSvmsmf5TwIhPpY9vINrpZvrt9wC8cFs8btI25GKjGGIiCLe48GmcIzLyFWUdUcYIEcFAUkS70F093+Qqnm9VU8Hz/KshSXiPOMmyu8UhOAiiBY3MgVkfDLJtRw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=mu6//+e6; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=tkMhGHMY; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="mu6//+e6"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="tkMhGHMY" Date: Thu, 21 May 2026 17:26:58 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1779377219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=LDy0+R7HMckONiYYfOlJ7OcJzEYOyVh9+dPemYEDfWc=; b=mu6//+e6TUUe8SBkOZF40FWXOaRmVGtXCcYkzTGhDOvceh1qOTsvRmcucSIaAzTpkEb0eF gQf5Jt0GFam6qLWJaZBJqKTuXiDvP+IJwqr6k9dD28sVQx5JQTBhwyRAMSVDQ3jnK0Jw8+ Mt2UeoPqmURw6YVp85A1dPWaRna3BU1Q6Bv5/culN4iVpl2N1aKQi/uLJh0p9tNQfNC1NS xGzgVfvoeX2r9ambS4b3TqqNod0PThNcARwmO4Owl47YGaEDbuNERzQcYpIkUR+VNQh2yO 7bd4X+ywkUo/ew22WmORQX3EEIvuOKCK5opIm6zxzs8IuygvdWE+v++JrXXG5A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1779377219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=LDy0+R7HMckONiYYfOlJ7OcJzEYOyVh9+dPemYEDfWc=; b=tkMhGHMYX2u9cK2itlWZRRGdj5ih5T+jOgTmx9PsBEvw8FDpNLw/tf8Gh2V3AhJfznKSo8 kKVGxd0weKonPiAg== From: Sebastian Andrzej Siewior To: Chuyi Zhou Cc: tglx@linutronix.de, mingo@redhat.com, luto@kernel.org, peterz@infradead.org, paulmck@kernel.org, muchun.song@linux.dev, bp@alien8.de, dave.hansen@linux.intel.com, pbonzini@redhat.com, clrkwllms@kernel.org, rostedt@goodmis.org, nadav.amit@gmail.com, linux-kernel@vger.kernel.org Subject: Re: [RESEND PATCH v5 04/12] smp: Use task-local IPI cpumask in smp_call_function_many_cond() Message-ID: <20260521152658.voQhpA6g@linutronix.de> References: <20260513124524.2569867-1-zhouchuyi@bytedance.com> <20260513124524.2569867-5-zhouchuyi@bytedance.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20260513124524.2569867-5-zhouchuyi@bytedance.com> On 2026-05-13 20:45:16 [+0800], Chuyi Zhou wrote: > diff --git a/kernel/smp.c b/kernel/smp.c > index 9e9dab3b0d51..630c8e5a635d 100644 > --- a/kernel/smp.c > +++ b/kernel/smp.c > @@ -811,11 +849,18 @@ static void smp_call_function_many_cond(const struct cpumask *mask, > int cpu, last_cpu, this_cpu = smp_processor_id(); > struct call_function_data *cfd; > bool wait = scf_flags & SCF_WAIT; > + struct cpumask *cpumask, *task_mask; > + bool preemptible_wait; > int nr_cpus = 0; > bool run_remote = false; > > lockdep_assert_preemption_disabled(); > > + task_mask = smp_task_ipi_mask(current); > + preemptible_wait = task_mask; > + cfd = this_cpu_ptr(&cfd_data); > + cpumask = preemptible_wait ? task_mask : cfd->cpumask; Is this a porting artifact? preemptible_wait is a bool while task_mask is a pointer which is always != NULL. UP to here the patches and the code made sense. > + > /* > * Can deadlock when called with interrupts disabled. > * We allow cpu's that are not yet online though, as no one else can Sebastian