From nobody Mon Jun 8 05:26:21 2026 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 F2C98322522; Tue, 2 Jun 2026 19:35:54 +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=1780428956; cv=none; b=FNTJiyXA/vxo/9v3oTl5QAcd9PvCAtR6vqJ9DDH1ezldn8qiznvpCw8WXGixHxPhqc+PXuz4KizqaB3RyHNhy3DYDYhHmF23Ndc00Fb/owKuJPjhlZ4F79XUHiTMzCZBEuYohr5+Z3YMzG8NExv5g9mMEvZbDPnXpygFaKhOPck= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780428956; c=relaxed/simple; bh=E/3LD/zdOZINevX4c3ivwLNFLzoJ7PkeIXHxPrkAOAo=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=o9DURx5wPSE1ElNoLy+y0CmwmilHYH9RsjgLxDrC3ZXdtWmJuC3b+OFHbBERklVpFpowgsyyf4WcyXQ8JQ1gyeh9Gb8VXURt3MA79YNdK6ZL0df6+5fcMXZEOhUkFVCKrUHHDuuXujtWTizognqPdHUFw6dp06Y36wuSZknKWGs= 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=pT1rPyQq; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=ERFL7JYz; 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="pT1rPyQq"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ERFL7JYz" Date: Tue, 02 Jun 2026 19:35:52 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1780428953; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+brMxszHHcahEmakdVb0a9Y7IJmvbWfr/NMIxIzr8/4=; b=pT1rPyQqK74GcL8kwyHLhZduPq7YfUEfBHctGTMudAcBfSXLK+d4feF3y5I+Y22+iIxj2D kv64MioU8DNc5cprRyaSjo6bwaDoI+iFoz0hxTN/gbqcLPXJ4eG71CZlRPsiclbdnPqQ5s ru/qi1lQWvp1nryUyqbfI11AyE7qqo9k+ewV2aYl8jYlTw6nqaCosY1rIlZ/PCv714FIU2 Dd5MWXuMrsuUc50DBQkFHgjWykWhIJ9jMvA265IKfSVlf6JpejzRn6Th5zm7aPzAV5u3kK 1+6MYUvy1oLJAXUz61AyohLwlvkP3Wyxj5i6/MKBPH1ECDXw4Dw3123am6jcIg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1780428953; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+brMxszHHcahEmakdVb0a9Y7IJmvbWfr/NMIxIzr8/4=; b=ERFL7JYzl0oz35Q/8FAUQgKFI5E39eDAqcg6HoqymT07Ht1RmqOcDR0IzLIAPpO6JcGIUz 0xgdkrd4Ucvt1ZCw== From: "tip-bot2 for Frederic Weisbecker" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: timers/core] timers/migration: Deactivate per-capacity hierarchies under nohz_full Cc: Frederic Weisbecker , Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260519220926.63437-3-frederic@kernel.org> References: <20260519220926.63437-3-frederic@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <178042895227.710.11596946365756745775.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the timers/core branch of tip: Commit-ID: d4f198c13611257f7f29d3c614721d0ac5d362f5 Gitweb: https://git.kernel.org/tip/d4f198c13611257f7f29d3c614721d0ac= 5d362f5 Author: Frederic Weisbecker AuthorDate: Wed, 20 May 2026 00:09:26 +02:00 Committer: Thomas Gleixner CommitterDate: Tue, 02 Jun 2026 21:34:03 +02:00 timers/migration: Deactivate per-capacity hierarchies under nohz_full NOHZ_FULL CPUs global timers are guaranteed to be handled by the timekeeper CPU, which never stops its tick and therefore remains active in the hierarchy. But since the introduction of per-capacity hierarchies, this guarantee is broken because the timekeeper may not belong to the same hierarchy as all the NOHZ_FULL CPUs. Fix it with simply turning off capacity awareness when NOHZ_FULL is running and force a single hierarchy. NOHZ_FULL is not exactly optimized powerwise anyway. Fixes: 098cbaad8e57 ("timers/migration: Split per-capacity hierarchies") Signed-off-by: Frederic Weisbecker Signed-off-by: Thomas Gleixner Link: https://patch.msgid.link/20260519220926.63437-3-frederic@kernel.org --- kernel/time/timer_migration.c | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/kernel/time/timer_migration.c b/kernel/time/timer_migration.c index 8032b00..8ba53ad 100644 --- a/kernel/time/timer_migration.c +++ b/kernel/time/timer_migration.c @@ -1464,8 +1464,24 @@ static long tmigr_trigger_active(void *unused) return 0; } =20 -static struct tmigr_hierarchy *__tmigr_get_hierarchy(unsigned int capacity) +static unsigned int tmigr_get_capacity(int cpu) { + /* + * nohz_full CPUs need to make sure there is always an available (online) + * and never idle migrator to handle all their global timers. That duty + * is served by the timekeeper which then never stops its tick. But the + * timekeeper must then belong to the same hierarchy as all the nohz_full + * CPUs. Simply turn off capacity awareness when nohz_full is running. + */ + if (tick_nohz_full_enabled()) + return SCHED_CAPACITY_SCALE; + else + return arch_scale_cpu_capacity(cpu); +} + +static struct tmigr_hierarchy *__tmigr_get_hierarchy(int cpu) +{ + unsigned int capacity =3D tmigr_get_capacity(cpu); struct tmigr_hierarchy *iter; =20 list_for_each_entry(iter, &tmigr_hierarchy_list, node) { @@ -1500,7 +1516,7 @@ static int tmigr_clear_cpu_available(unsigned int cpu) } =20 if (firstexp !=3D KTIME_MAX) { - struct tmigr_hierarchy *hier =3D __tmigr_get_hierarchy(arch_scale_cpu_ca= pacity(cpu)); + struct tmigr_hierarchy *hier =3D __tmigr_get_hierarchy(cpu); =20 if (WARN_ON_ONCE(!hier)) return -EINVAL; @@ -1938,11 +1954,11 @@ out: return err; } =20 -static struct tmigr_hierarchy *tmigr_get_hierarchy(unsigned int capacity) +static struct tmigr_hierarchy *tmigr_get_hierarchy(int cpu) { struct tmigr_hierarchy *hier; =20 - hier =3D __tmigr_get_hierarchy(capacity); + hier =3D __tmigr_get_hierarchy(cpu); =20 if (hier) return hier; @@ -1962,7 +1978,7 @@ static struct tmigr_hierarchy *tmigr_get_hierarchy(un= signed int capacity) for (int i =3D 0; i < tmigr_hierarchy_levels; i++) INIT_LIST_HEAD(&hier->level_list[i]); =20 - hier->capacity =3D capacity; + hier->capacity =3D tmigr_get_capacity(cpu); list_add_tail(&hier->node, &tmigr_hierarchy_list); =20 return hier; @@ -2000,7 +2016,7 @@ static long connect_old_root_work(void *arg) struct tmigr_hierarchy *hier; int cpu =3D smp_processor_id(); =20 - hier =3D __tmigr_get_hierarchy(arch_scale_cpu_capacity(cpu)); + hier =3D __tmigr_get_hierarchy(cpu); if (WARN_ON_ONCE(!hier)) return -EINVAL; =20 @@ -2016,7 +2032,7 @@ static int tmigr_add_cpu(unsigned int cpu) =20 guard(mutex)(&tmigr_mutex); =20 - hier =3D tmigr_get_hierarchy(arch_scale_cpu_capacity(cpu)); + hier =3D tmigr_get_hierarchy(cpu); if (IS_ERR(hier)) return PTR_ERR(hier); =20