From nobody Mon Feb 9 14:31:31 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 27F9B2F83DE for ; Mon, 20 Oct 2025 11:28:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760959716; cv=none; b=ajdJ/2WHJb5yyxtdiJRVhSNbHys31LDu9aTBwngHDIUsbPMMWoW4hFs93jWhOg7aFvjVesSgupmY/YWx7fzRiZ9C10V7awFal1uoocwVNL1934FOk2+ynH60smmT3lzGJ/9G43i5wgDZqsTodp3kq4xGUrObgS08bZ5Sl03TIQc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760959716; c=relaxed/simple; bh=orl97ADICI4ifLLSRLAlatiFb35y7EONMQ1cCnXv80k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UO1OstrZZScGgS4wbDQLjB7pGsHq86LkFTT7cjPA8CGjiiBuafGWJ4sgLHzNBWOWkJw3lS6XKpN5mBqjjMHZofqnuNqF6G4K0Zh/ljWnKNbOytE1zlAoSeSJgKhBmHQCk0LZlgfOibzWgcTKGTU515eYeeQTOpWUg/fRdQ6489w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=VpUMGUhj; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="VpUMGUhj" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1760959713; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gYezNvw2JXA2eYKqYkaBQbpJb87hLMjOLjuBiAHIOFM=; b=VpUMGUhjP0c2Yf9W6xWWTMPlrrNyT0/PeIHcHtSSQPlktYFpMCDNPlnBZifRTzZqTIKHb4 fSuU17x8c22x2LOTeB3ILc0NSTHS0n0OGz9ZGZR6pNXUasL+6xwXLjdJw6qGd1qyzOWoCr VRBdm1lOghTNtysO3ebyL94mviHGBRs= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-218-LcEJa8GvPYWtK5C-1usQcQ-1; Mon, 20 Oct 2025 07:28:28 -0400 X-MC-Unique: LcEJa8GvPYWtK5C-1usQcQ-1 X-Mimecast-MFC-AGG-ID: LcEJa8GvPYWtK5C-1usQcQ_1760959707 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 15EF018002F9; Mon, 20 Oct 2025 11:28:27 +0000 (UTC) Received: from gmonaco-thinkpadt14gen3.rmtit.csb (unknown [10.44.34.114]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A7A931955F22; Mon, 20 Oct 2025 11:28:24 +0000 (UTC) From: Gabriele Monaco To: linux-kernel@vger.kernel.org, Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , Waiman Long Cc: Gabriele Monaco Subject: [RESEND PATCH v13 6/9] sched/isolation: Force housekeeping if isolcpus and nohz_full don't leave any Date: Mon, 20 Oct 2025 13:27:59 +0200 Message-ID: <20251020112802.102451-7-gmonaco@redhat.com> In-Reply-To: <20251020112802.102451-1-gmonaco@redhat.com> References: <20251020112802.102451-1-gmonaco@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Content-Type: text/plain; charset="utf-8" Currently the user can set up isolcpus and nohz_full in such a way that leaves no housekeeping CPU (i.e. no CPU that is neither domain isolated nor nohz full). This can be a problem for other subsystems (e.g. the timer wheel imgration). Prevent this configuration by invalidating the last setting in case the union of isolcpus (domain) and nohz_full covers all CPUs. Reviewed-by: Waiman Long Reviewed-by: Frederic Weisbecker Signed-off-by: Gabriele Monaco --- kernel/sched/isolation.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/kernel/sched/isolation.c b/kernel/sched/isolation.c index a4cf17b1fab0..3ad0d6df6a0a 100644 --- a/kernel/sched/isolation.c +++ b/kernel/sched/isolation.c @@ -167,6 +167,29 @@ static int __init housekeeping_setup(char *str, unsign= ed long flags) } } =20 + /* + * Check the combination of nohz_full and isolcpus=3Ddomain, + * necessary to avoid problems with the timer migration + * hierarchy. managed_irq is ignored by this check since it + * isn't considered in the timer migration logic. + */ + iter_flags =3D housekeeping.flags & (HK_FLAG_KERNEL_NOISE | HK_FLAG_DOMA= IN); + type =3D find_first_bit(&iter_flags, HK_TYPE_MAX); + /* + * Pass the check if none of these flags were previously set or + * are not in the current selection. + */ + iter_flags =3D flags & (HK_FLAG_KERNEL_NOISE | HK_FLAG_DOMAIN); + first_cpu =3D (type =3D=3D HK_TYPE_MAX || !iter_flags) ? 0 : + cpumask_first_and_and(cpu_present_mask, + housekeeping_staging, housekeeping.cpumasks[type]); + if (first_cpu >=3D min(nr_cpu_ids, setup_max_cpus)) { + pr_warn("Housekeeping: must include one present CPU " + "neither in nohz_full=3D nor in isolcpus=3Ddomain, " + "ignoring setting %s\n", str); + goto free_housekeeping_staging; + } + iter_flags =3D flags & ~housekeeping.flags; =20 for_each_set_bit(type, &iter_flags, HK_TYPE_MAX) --=20 2.51.0