From nobody Sat Jun 13 17:06:24 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 88CA1371052; Wed, 6 May 2026 07:11:43 +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=1778051505; cv=none; b=oWZEqzfXZVbEmFf7F8hWV0mNw547qFa8VUA+3lLflx2wj3PqONI4Igg+FgZqfcQinQFEJylWbUa/HHns1q7ctHR94Bej99ngWZnFyothEjEkQhogQmhdqRSM14jyafBb7n3EDd9vsJbL5t6dMZ9pY7TDIcZ358wPFPZPPs4vw6k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778051505; c=relaxed/simple; bh=0hvXGK/zPIQjdLYdvvn4WCcfRtyNdi8vfRIQWExtqhU=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=e0E2IS5pYAMYLUpZLUccqzofcKF51ycYlZnc4fdAFTjEbXxC6zZ6icfwyCY4qST4JmCjInmBMsixK2ab+I/ye6GcihxM0x7ibb0J5/fz7XOI03dreCyEA4OKhRvxhBA3DKBKrX3OBKhiUpSJMCV+O2/qzyVY8rmpymhmX0RV928= 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=UBFGM19y; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=qZVAYfvi; 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="UBFGM19y"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="qZVAYfvi" Date: Wed, 06 May 2026 07:11:40 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1778051502; 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=1w8MTeMw6oh5TbTXtYGHHkTr6OTSRPLQ2dtMY3UPJEY=; b=UBFGM19yTdEhVLy/1ptkduQT0yVJgylquDFtGVypDuaz8dZfMEtSuS7Wc4/KpgODEez58k oD5PDFL88if3CG8L6YgtotUcjHyaEiaJtgBatBrq7GgusA4fuGa0FfXRWsYtR/Gm/TirLo v/+/5bqC9aWwwTfxpgrRJHs0pcyPDhMZb5Iul4Vxe3XQ+wvyXFvzDcSC9Q1v5SRnHbKoYG XSFzMDLpj3JsSCy++yimmqXJrJcNLXjWdqtF4sO42OJ4dZ+uQutl3R6j3aFr4i0UxZIV3l kOPF9w/WObV7en0lHVYw6fx2/EC9GZBshPoUzFLCgUQP2XJDsa8ba2b10iiygw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1778051502; 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=1w8MTeMw6oh5TbTXtYGHHkTr6OTSRPLQ2dtMY3UPJEY=; b=qZVAYfvi7/w9+5A051IJ/aysr+sz3vR9PqTKkpf+lu2Pgjq3121bWAA9OYUgcSIJqRtB48 V8zsmnGBg91w/eCQ== 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: Track CPUs in a hierarchy Cc: Frederic Weisbecker , Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260423165354.95152-4-frederic@kernel.org> References: <20260423165354.95152-4-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: <177805150083.424702.3916166576545919969.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: 3ba25488380fd76230442df366c464c6e1fd6485 Gitweb: https://git.kernel.org/tip/3ba25488380fd76230442df366c464c6e= 1fd6485 Author: Frederic Weisbecker AuthorDate: Thu, 23 Apr 2026 18:53:51 +02:00 Committer: Thomas Gleixner CommitterDate: Wed, 06 May 2026 08:33:06 +02:00 timers/migration: Track CPUs in a hierarchy When a new root is created, the old root is connected to it and propagates up its own assumed to be active state, since the hotplug control CPU is itself active and part of the old root. However with per-capacity hierarchies, this assumption won't be true anymore because the hotplug control CPU calling the timer migration prepare callback may not belong to the same hierarchy as the booting CPU. To solve this, track the available CPUs per hierarchies so that the root connection can be offlined to safe CPUs. Signed-off-by: Frederic Weisbecker Signed-off-by: Thomas Gleixner Link: https://patch.msgid.link/20260423165354.95152-4-frederic@kernel.org --- kernel/time/timer_migration.c | 24 ++++++++++++++++++------ kernel/time/timer_migration.h | 2 ++ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/kernel/time/timer_migration.c b/kernel/time/timer_migration.c index a8ec85f..a68b9c7 100644 --- a/kernel/time/timer_migration.c +++ b/kernel/time/timer_migration.c @@ -1916,17 +1916,23 @@ static struct tmigr_hierarchy *tmigr_get_hierarchy(= void) if (!hierarchy) return ERR_PTR(-ENOMEM); =20 + hierarchy->cpumask =3D kzalloc(cpumask_size(), GFP_KERNEL); + if (!hierarchy->cpumask) + goto err; + hierarchy->level_list =3D kzalloc_objs(struct list_head, tmigr_hierarchy_= levels); - if (!hierarchy->level_list) { - kfree(hierarchy); - hierarchy =3D NULL; - return ERR_PTR(-ENOMEM); - } + if (!hierarchy->level_list) + goto err; =20 for (int i =3D 0; i < tmigr_hierarchy_levels; i++) INIT_LIST_HEAD(&hierarchy->level_list[i]); =20 return hierarchy; +err: + kfree(hierarchy->cpumask); + kfree(hierarchy); + hierarchy =3D NULL; + return ERR_PTR(-ENOMEM); } =20 static int tmigr_add_cpu(unsigned int cpu) @@ -1946,8 +1952,11 @@ static int tmigr_add_cpu(unsigned int cpu) =20 ret =3D tmigr_setup_groups(hier, cpu, node, NULL, false); =20 + if (ret < 0) + return ret; + /* Root has changed? Connect the old one to the new */ - if (ret >=3D 0 && old_root && old_root !=3D hier->root) { + if (old_root && old_root !=3D hier->root) { /* * The target CPU must never do the prepare work, except * on early boot when the boot CPU is the target. Otherwise @@ -1964,6 +1973,9 @@ static int tmigr_add_cpu(unsigned int cpu) ret =3D tmigr_setup_groups(hier, -1, old_root->numa_node, old_root, true= ); } =20 + if (ret >=3D 0) + cpumask_set_cpu(cpu, hier->cpumask); + return ret; } =20 diff --git a/kernel/time/timer_migration.h b/kernel/time/timer_migration.h index 77df422..0cfbb8d 100644 --- a/kernel/time/timer_migration.h +++ b/kernel/time/timer_migration.h @@ -8,10 +8,12 @@ /** * struct tmigr_hierarchy - a hierarchy associated to a given CPU capacity. * @level_list: Per level lists of tmigr groups + * @cpumask: CPUs belonging to this hierarchy * @root: The current root of the hierarchy */ struct tmigr_hierarchy { struct list_head *level_list; + struct cpumask *cpumask; struct tmigr_group *root; }; =20