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 5D85D3C4B94 for ; Wed, 3 Jun 2026 11:00:59 +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=1780484460; cv=none; b=AKti0VgxekMU7pg2oLpWbJsB0l+CGKo4k4E0PGEGCN74cFnhogkUIMKoEEl6//N7PNMN24f3bERt4KHx6VR9m6vcgBMxHZf4t+9ForZwxOdOEfOTnZUUBSthgac3XEm4rWAtRzzey1QJdRGf+hx2+ci3u+f2/Xcbu8D/DFzUubA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780484460; c=relaxed/simple; bh=VM8aSzixv5SSLZZ2ltwktfX8FtMmI8jcX7A1uuIKLtc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GYSDXA0v//rizpfzFF33TiF0JFMbvbZ0x9kwQdQUv91ynWk+xyUx0KSNfHwTf4X7mccbOUd0JLomnaXFH0kaI/MKuIAIYgmeki4Nm/Moj+/RIj89zB+jVv8DgKxA4g+AoXJrKr4WjYFlBTICThHPXQZGeCfRctlfKKZawojireo= 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=EdtvCMx8; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=zjxHTg0i; 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="EdtvCMx8"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="zjxHTg0i" Date: Wed, 3 Jun 2026 13:00:56 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1780484457; 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=nIIYffO9QBjaYEc8rNVTjBGksQ1Yc2aLbk9x+9yJ1XU=; b=EdtvCMx8t+uVTP7dcQM5XNB6W0HDivxYRegch0Kx/rb0tm03Y1Ggri0E6cfvzH+GS4qqSI Aco56oQ21xPeoD5kGqI/Ud4LoQPEwQ/TUdZ160/q+lhdEOdTX7v2KiVJRwYN2RlV0o4Ode qrfrbk1oNOEteHiGcPEQKkQwNEp/2p22dOsORPa5SlUARHG/PXwvXScSiRO86UZXuZGOGV me1iCdDMONtQkAGeImPPbF4G0es9nD+jqGhMiD5RsuBkq6YBvtjxee0A2oSqan+QSZ97HS 5qN5GEvtf49UbOyCxic3O5okU6nol5zg4iqStts6dsA+C/GyyjxF4jaVrXbhsA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1780484457; 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=nIIYffO9QBjaYEc8rNVTjBGksQ1Yc2aLbk9x+9yJ1XU=; b=zjxHTg0ix5iUSi2ETvqbVbHL7+Zl0OD+k0PdTSHxHM8T1PU7qG247MOd9Fk0esvXHYMWnY fpHG9HiKJnRFn6Dw== From: Sebastian Andrzej Siewior To: Chuyi Zhou Cc: tglx@kernel.org, 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 v6 06/12] smp: Enable preemption early in smp_call_function_many_cond Message-ID: <20260603110056.kUcKG8er@linutronix.de> References: <20260528151338.617843-1-zhouchuyi@bytedance.com> <20260528151338.617843-7-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: <20260528151338.617843-7-zhouchuyi@bytedance.com> On 2026-05-28 23:13:32 [+0800], Chuyi Zhou wrote: > --- a/kernel/smp.c > +++ b/kernel/smp.c > @@ -953,6 +952,17 @@ static void smp_call_function_many_cond(const struct cpumask *mask, > local_irq_restore(flags); > } > > + /* > + * Waiting for completion can take time especially with many CPUs. > + * On a PREEMPTIBLE kernel a per-task cpumask is used to track CPUs I wouldn't use PREEMPTIBLE. It is PREEMPT which short for CONFIG_PREEMPT. PREEMPTIBLE is not a distinct entity since "preemptible" can be changed at runtime. > + * with pending IPI request. This allows to enable preemption and > + * potentially wait while allowing task preemption. On a !PREEMPTIBLE > + * the cpumask is shared and the call must block until completion to > + * avoid modifications by a another caller on this CPU. > + */ > + if (task_mask) > + put_cpu(); > + > if (run_remote && wait) { > for_each_cpu(cpu, cpumask) { > call_single_data_t *csd; Other than that, Reviewed-by: Sebastian Andrzej Siewior Sebastian