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 2316137CD44 for ; Wed, 1 Apr 2026 15:25:06 +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=1775057108; cv=none; b=W7IXcwT9Hd5scaZyos9T3iqPj3gNQm2lO8+IDrCUZi4ny/gUXbXGZLmaZyle3LOWWcAAMmEIFAjo0egGd5gcRLtqw78+nV64uQIB1PzE02rMhkbC1ogR6Y+1+BV9lYbamsRDx898AoFigfBGYLK0Kl33qG0WIZprsHPpCr2H8HM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775057108; c=relaxed/simple; bh=Iol4t8C8M8V0IRvKJgNTtGYbPa9ulqu9qnOZpRMXtrs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gGceyUv5KWgcIOyeZCVyw4uiBNtwe8C5I37kgRdIShqg5+oui9lmmRDmfgKCN8Z6BIaqQJWOVkww+x20IgE/SHY9cZqCnrv5I8X9xCRLDX1emOdTWhFDKCp5fAPiw5Xdh9RQMtyF3T4wJAc2Ahzj3KWQ7zyV7flIZkAzPPzx6rA= 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=oxzF5I0x; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=tYNmW5Bo; 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="oxzF5I0x"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="tYNmW5Bo" Date: Wed, 1 Apr 2026 17:25:00 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1775057101; 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=owqm8zLPSj9Kx+6UlTU7oa7gJRRu37QwGdKyTj27Syc=; b=oxzF5I0xF64zafpbiDiKTRvNIymOJsNsLNLRHfBvqSlVxAblMFrOogYnfTce4ggToNPK75 Ps+d5mqtYvQhu7TGQv0mDayKCu6WsUFio8/ja/4EIW3z7lCLH8v25qLT3dxG6BL/qUR1lt t14Ffho7i8+rIN2zaVqsHI3vNN2A8h7a0LlXc7zLbJnIxsrJPvrl0awcTs2Gb1Yte/LmD8 SxNXi+64BSzWFXxV9LI3loZIRuAo9Me52SGOFywhJ3lWMND/MNUSEBCgQTSxHhCYHurpHY l+O1eKIjMC10OfUitmssHOsvDtJhH7s9CjbgBZsjvP1aF/OrjSX+Ttdm/fFhGQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1775057101; 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=owqm8zLPSj9Kx+6UlTU7oa7gJRRu37QwGdKyTj27Syc=; b=tYNmW5BoEWa7txBrIBzUn5Tl4/ePKpUOry5DtOCHxuJYDVi6ZF8fdy0JVjdwGtLfdZhV7E 8FkHptO47oRo9FCw== 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: [PATCH v4 04/12] smp: Use task-local IPI cpumask in smp_call_function_many_cond() Message-ID: <20260401152500.h0-icgXE@linutronix.de> References: <20260331113103.2197007-1-zhouchuyi@bytedance.com> <20260331113103.2197007-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: <20260331113103.2197007-5-zhouchuyi@bytedance.com> On 2026-03-31 19:30:55 [+0800], Chuyi Zhou wrote: > --- a/kernel/smp.c > +++ b/kernel/smp.c > @@ -802,11 +840,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 && preemptible(); > + cfd = this_cpu_ptr(&cfd_data); > + cpumask = preemptible_wait ? task_mask : cfd->cpumask; I haven't look at this in detail but that lockdep_assert_preemption_disabled() expects preemption to be disabled here so the following preemptible() must be always false. > + > /* > * Can deadlock when called with interrupts disabled. > * We allow cpu's that are not yet online though, as no one else can Sebastian