From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from va-1-114.ptr.blmpb.com (va-1-114.ptr.blmpb.com [209.127.230.114]) (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 EE29B39EF0C for ; Wed, 1 Apr 2026 15:38:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.127.230.114 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775057935; cv=none; b=APwi5nrnUdOb/Nf7SoWudk69hTgr21ke5qRoHGKudewWJlZxyrRgKyFtCbypSJKEZhevokIezgEfCDSawjZEAHNNRRBOwEbPz+9H9Xg6vSOLK9QZDVBnbandW3fwZXDfp6HCBZaGU+4qyUKeXJD1EVEM4lWt1kZEciT7DNSKYko= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775057935; c=relaxed/simple; bh=4hO8AtBUUU3+6JsdOhrGUB4RhHqN6Ob8aKgQztCfMW0=; h=Date:References:To:Mime-Version:In-Reply-To:Content-Type:From: Subject:Cc:Message-Id; b=dq7QbqChEA/tQ9XK//JvCSOd9wlzfyWTI02CdMy9dO5y19ea4b1T2Te6FMzeGB4kra/G7yZmO+dJjtUKGVlSTpDFMnul2u4HTL8+O+PfPmVW4D+J3B0I2elhAAY9eyHBAUWPEETMyPG6K9nP+rHG5N6akzDP+J0ijAP5Wa44tvk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com; spf=pass smtp.mailfrom=bytedance.com; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b=Uf9xbqk1; arc=none smtp.client-ip=209.127.230.114 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bytedance.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="Uf9xbqk1" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=2212171451; d=bytedance.com; t=1775057923; h=from:subject: mime-version:from:date:message-id:subject:to:cc:reply-to:content-type: mime-version:in-reply-to:message-id; bh=Df2lsSthZd0+HtBTylsT1pYysf85ORGg1/s4VDa01S8=; b=Uf9xbqk1cJmKV7jFjTQfYJyEaVzw4wUYrCJ+LcTB2Rho01BOkX9SmDc7YqORxL704pJuae PKasZKqzoJ6Z8FrT/bRUsdGSek3fCAf4DjsPtc9Cg26nauCkm0soIh2EpNTrCoachPoBXg iQuw4e2AiBpkbykMUNGCnRBIOrhkCigTdr0bw4ssOybG0hsOy3qUKEbqc3400hrVZwd8HP 8ekGO5lZU8OBEEj5frV2gl5KvYA6QI2jO8C2IQOtUL68vNXDJtd5r12UVqq4HLDqVKAN0g KcwBh3hsbFBB97qqrPkBf9S1nUikvC0/XhxP5rl0GBA4VyoLkvzlC/t1DOAO6A== X-Lms-Return-Path: Date: Wed, 1 Apr 2026 23:38:24 +0800 References: <20260331113103.2197007-1-zhouchuyi@bytedance.com> <20260331113103.2197007-5-zhouchuyi@bytedance.com> <20260401152500.h0-icgXE@linutronix.de> Content-Transfer-Encoding: 7bit To: "Sebastian Andrzej Siewior" X-Original-From: Chuyi Zhou Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 In-Reply-To: <20260401152500.h0-icgXE@linutronix.de> User-Agent: Mozilla Thunderbird Content-Type: text/plain; charset=UTF-8 From: "Chuyi Zhou" Subject: Re: [PATCH v4 04/12] smp: Use task-local IPI cpumask in smp_call_function_many_cond() Cc: , , , , , , , , , , , , Message-Id: On 2026-04-01 11:25 p.m., Sebastian Andrzej Siewior wrote: > 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. > Yes, perhaps the preemptible() check is not needed in this patch. It would be better to add the preemptible() check in [patch 06/12]. >> + >> /* >> * Can deadlock when called with interrupts disabled. >> * We allow cpu's that are not yet online though, as no one else can > > Sebastian