From nobody Sun Feb 8 00:26:12 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 D62BF6FBF for ; Sat, 21 Sep 2024 19:08:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726945682; cv=none; b=ZOvnPI7GE6vpdQ4mud94NGjZHqIiuzurBzHbpITsmaAM54XxafzRyEH2pKQdsKIajuZaSg0fEbooPMA+M0VxDAPYD0nEQlHhdMkLyFQDETw9dlct34rofHwAFBb3w226GH2pTV2NWt4WOEFFGRHhDilR2N1mjTYLs9GizeKyVos= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726945682; c=relaxed/simple; bh=iF/UcEocnjX8RWhBeAD98LQCH1lLpp4Zs42WIZlDuqg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=g1WZIOxS4JuelH3zSKOZEYa7ir4GzyMGmqXyY+co59SdbfTqMIrqQ21cnmKI2Vsenm55OmDKhSvpayWD6okq4viQvKGxiLpFBw5mi0ubs8y0y1IFiY4/FGEfeb5fASMKbOra2Zd3a1wP2u1qUv8tnY32d/SO3L7/gLjlozGsaew= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none 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=eJ9UYKRy; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none 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="eJ9UYKRy" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1726945679; 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=xThVtH+joJtOehvucbRrBkg1RCKvDrrEyEnwMld3cXo=; b=eJ9UYKRyMp+lVuxMI51Tv8UNBwf2bopixMnoBpFdh4X60G3BZUng3uajFPee8kTazCndDp 59xBa3IHixk2RY6Ox76EDQ0sVe6bbnltU0C9UkM48KTRwwHXtmE6xsT/O64q3CqJ9PoJjw /HfoBJZ1X03Hfsajscelrn+xNMrKVAA= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-349-piLTjTyAPFGuiO6KbTs6Tg-1; Sat, 21 Sep 2024 15:07:56 -0400 X-MC-Unique: piLTjTyAPFGuiO6KbTs6Tg-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.12]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2472E18F49BE; Sat, 21 Sep 2024 19:07:55 +0000 (UTC) Received: from llong.com (unknown [10.45.224.27]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id EE57E19560AB; Sat, 21 Sep 2024 19:07:50 +0000 (UTC) From: Waiman Long To: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Frederic Weisbecker Cc: linux-kernel@vger.kernel.org, Phil Auld , Waiman Long Subject: [PATCH v4 1/4] sched/core: Remove HK_TYPE_SCHED Date: Sat, 21 Sep 2024 15:07:17 -0400 Message-ID: <20240921190720.106195-2-longman@redhat.com> In-Reply-To: <20240921190720.106195-1-longman@redhat.com> References: <20240921190720.106195-1-longman@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.12 Content-Type: text/plain; charset="utf-8" The HK_TYPE_SCHED housekeeping type is defined but not set anywhere. So any code that try to use HK_TYPE_SCHED are essentially dead code. So remove HK_TYPE_SCHED and any code that use it. Signed-off-by: Waiman Long Acked-by: Frederic Weisbecker --- include/linux/sched/isolation.h | 1 - kernel/sched/fair.c | 14 -------------- kernel/sched/isolation.c | 1 - 3 files changed, 16 deletions(-) diff --git a/include/linux/sched/isolation.h b/include/linux/sched/isolatio= n.h index 2b461129d1fa..499d5e480882 100644 --- a/include/linux/sched/isolation.h +++ b/include/linux/sched/isolation.h @@ -10,7 +10,6 @@ enum hk_type { HK_TYPE_TIMER, HK_TYPE_RCU, HK_TYPE_MISC, - HK_TYPE_SCHED, HK_TYPE_TICK, HK_TYPE_DOMAIN, HK_TYPE_WQ, diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index b9784e13e6b6..f76690c15bfe 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -12202,9 +12202,6 @@ static inline int on_null_domain(struct rq *rq) * - When one of the busy CPUs notices that there may be an idle rebalanci= ng * needed, they will kick the idle load balancer, which then does idle * load balancing for all the idle CPUs. - * - * - HK_TYPE_MISC CPUs are used for this task, because HK_TYPE_SCHED is no= t set - * anywhere yet. */ static inline int find_new_ilb(void) { @@ -12449,10 +12446,6 @@ void nohz_balance_enter_idle(int cpu) if (!cpu_active(cpu)) return; =20 - /* Spare idle load balancing on CPUs that don't want to be disturbed: */ - if (!housekeeping_cpu(cpu, HK_TYPE_SCHED)) - return; - /* * Can be set safely without rq->lock held * If a clear happens, it will have evaluated last additions because @@ -12672,13 +12665,6 @@ static void nohz_newidle_balance(struct rq *this_r= q) { int this_cpu =3D this_rq->cpu; =20 - /* - * This CPU doesn't want to be disturbed by scheduler - * housekeeping - */ - if (!housekeeping_cpu(this_cpu, HK_TYPE_SCHED)) - return; - /* Will wake up very soon. No time for doing anything else*/ if (this_rq->avg_idle < sysctl_sched_migration_cost) return; diff --git a/kernel/sched/isolation.c b/kernel/sched/isolation.c index 5891e715f00d..5345e11f3d44 100644 --- a/kernel/sched/isolation.c +++ b/kernel/sched/isolation.c @@ -12,7 +12,6 @@ enum hk_flags { HK_FLAG_TIMER =3D BIT(HK_TYPE_TIMER), HK_FLAG_RCU =3D BIT(HK_TYPE_RCU), HK_FLAG_MISC =3D BIT(HK_TYPE_MISC), - HK_FLAG_SCHED =3D BIT(HK_TYPE_SCHED), HK_FLAG_TICK =3D BIT(HK_TYPE_TICK), HK_FLAG_DOMAIN =3D BIT(HK_TYPE_DOMAIN), HK_FLAG_WQ =3D BIT(HK_TYPE_WQ), --=20 2.43.5 From nobody Sun Feb 8 00:26:12 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 C3086126BF3 for ; Sat, 21 Sep 2024 19:08:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726945687; cv=none; b=RLTzU0ZiQHazxU+9viM+wzv/lAxpNn+GHrZfUFtJ9PtuS0WkUbPAmzO4D5aAqk5DJrIUXK9ZbWAfFvshuJAUD9BKtJlpgZU0UGJEyWvtKpZZWYwsIvAjwFeDqr9g3+D5epssejhDoff2VIYMo/4yuKkvv8qf0MpwdqNCIfiT/7Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726945687; c=relaxed/simple; bh=VQeNTpXMIwAp46t86U24dnCwflvwKJxs+ep3wJU+cj0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oczdLGRCEzQJmYMm7IKf/HDZgBfaAKYDl3RhXFVMP2UENClz8zPwRRFfwmEmfsZegArBCZZrga2JdEVvNE3+hwNKgL+NNSto+yxw5tnOxkykXaNa/KcyAm83hJWnVQM8y0ZPUIle/k8iBaYn9fkD6QWOhI0pca1d9pkOxOw2b4Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none 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=DJpSZAkt; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none 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="DJpSZAkt" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1726945684; 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=TgVcm3Qd2yD7/d4w7weoF1xnG5k0KKeLeGB66utTa4g=; b=DJpSZAktWF4KEI0DIu0aFWPHlNfL7/6+bW0RWI55SDF9jzKDWPp0HfWKxJugUwDBrhGsWn mWyIVWztQu/mEiSqEp/k5pi5VHLxDG5DPeGpdarLPe7Jkmy5EECO6p5tWG3coOB2JH+zBe zgyrx2WLz6FT1v+eqt8lQJ+z9GhFQAw= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-651-_2XP1_9BNFGVHI8Sc1_a2A-1; Sat, 21 Sep 2024 15:08:01 -0400 X-MC-Unique: _2XP1_9BNFGVHI8Sc1_a2A-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.12]) (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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CDEA5192E27C; Sat, 21 Sep 2024 19:07:59 +0000 (UTC) Received: from llong.com (unknown [10.45.224.27]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9650219560AB; Sat, 21 Sep 2024 19:07:55 +0000 (UTC) From: Waiman Long To: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Frederic Weisbecker Cc: linux-kernel@vger.kernel.org, Phil Auld , Waiman Long Subject: [PATCH v4 2/4] sched/isolation: Make "isolcpus=nohz" equivalent to "nohz_full" Date: Sat, 21 Sep 2024 15:07:18 -0400 Message-ID: <20240921190720.106195-3-longman@redhat.com> In-Reply-To: <20240921190720.106195-1-longman@redhat.com> References: <20240921190720.106195-1-longman@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.12 Content-Type: text/plain; charset="utf-8" The "isolcpus=3Dnohz" boot parameter and flag were used to disable tick when running a single task. Nowsdays, this "nohz" flag is seldomly used as it is included as part of the "nohz_full" parameter. Extend this flag to cover other kernel noises disabled by the "nohz_full" parameter to make them equivalent. This also eliminates the need to use both the "isolcpus" and the "nohz_full" parameters to fully isolated a given set of CPUs. Suggested-by: Frederic Weisbecker Signed-off-by: Waiman Long Acked-by: Frederic Weisbecker --- Documentation/admin-guide/kernel-parameters.txt | 4 +++- kernel/sched/isolation.c | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentatio= n/admin-guide/kernel-parameters.txt index 8337d0fed311..4e664587943f 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -2424,7 +2424,9 @@ specified in the flag list (default: domain): =20 nohz - Disable the tick when a single task runs. + Disable the tick when a single task runs as well as + disabling other kernel noises like having RCU callbacks + offloaded. This is equivalent to the nohz_full parameter. =20 A residual 1Hz tick is offloaded to workqueues, which you need to affine to housekeeping through the global diff --git a/kernel/sched/isolation.c b/kernel/sched/isolation.c index 5345e11f3d44..6a686322ce3c 100644 --- a/kernel/sched/isolation.c +++ b/kernel/sched/isolation.c @@ -209,9 +209,13 @@ static int __init housekeeping_isolcpus_setup(char *st= r) int len; =20 while (isalpha(*str)) { + /* + * isolcpus=3Dnohz is equivalent to nohz_full. + */ if (!strncmp(str, "nohz,", 5)) { str +=3D 5; - flags |=3D HK_FLAG_TICK; + flags |=3D HK_FLAG_TICK | HK_FLAG_WQ | HK_FLAG_TIMER | + HK_FLAG_RCU | HK_FLAG_MISC | HK_FLAG_KTHREAD; continue; } =20 --=20 2.43.5 From nobody Sun Feb 8 00:26:12 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 0D0906F31C for ; Sat, 21 Sep 2024 19:08:11 +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=1726945694; cv=none; b=ExOZzJou/lx4Q39ml1AnXDwiLnjTyXLYk1+/75sttiMPgYxG6hPRn6SsxkoxQIVvTT9d2YzmDlRrXSYyC5Pz46fvS6SdJ56/ii9w5L666joRxGI2vg5eI9B74HOLKAz0b4TumoXg7LZm4mVMU5h7atOfN5TS4roVjj0HM3nEVU8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726945694; c=relaxed/simple; bh=gdccsATwyxYiKvGqAp+hnays6GJPcIJtD9yJKfOiFok=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BKHSkyshhe9hgGvR6Vs/w2iOQ3NZy4aaawS0TfseTJRfCTam8cPA64+k1DtO5E45OnBqJewUdJN+o+lBlj/z8/dplqMvZQZtu3ZtZRPyw8QOvN22bXe6UcGQeOnSxg8Iz6LbC2AzF1zgB+y/5awwqzI5Agalj0pAc9AoEnUy8dk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none 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=Ge0Iq3Hc; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none 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="Ge0Iq3Hc" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1726945690; 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=wLhcR5B72XYdto26kcrhjcPLF7XsGM8+r+8PlFV5pB8=; b=Ge0Iq3HcelWgAHu529Q51KkNln4xzrYdtsaCL5y4H+j91RFSOgA6V1/+eoBG58zfz3cSe3 MCeAABz1zGWiicBvqhfw8Q4jAhxTLrsXzjVWmnPl0XCoSEEmAR+roD2Vuo8GvXjcaC6DZZ 7CkvSBA2VPA9I39yJKiCuGNHDcZJVqo= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-256-5f_Uho6-MQatVRUxuYr1sw-1; Sat, 21 Sep 2024 15:08:07 -0400 X-MC-Unique: 5f_Uho6-MQatVRUxuYr1sw-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.12]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A4DF018FDEDC; Sat, 21 Sep 2024 19:08:05 +0000 (UTC) Received: from llong.com (unknown [10.45.224.27]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4C1A519560AB; Sat, 21 Sep 2024 19:08:00 +0000 (UTC) From: Waiman Long To: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Frederic Weisbecker Cc: linux-kernel@vger.kernel.org, Phil Auld , Waiman Long Subject: [PATCH v4 3/4] sched/isolation: Consolidate housekeeping cpumasks that are always identical Date: Sat, 21 Sep 2024 15:07:19 -0400 Message-ID: <20240921190720.106195-4-longman@redhat.com> In-Reply-To: <20240921190720.106195-1-longman@redhat.com> References: <20240921190720.106195-1-longman@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.12 Content-Type: text/plain; charset="utf-8" The housekeeping cpumasks are only set by two boot commandline parameters: "nohz_full" and "isolcpus". When there is more than one of "nohz_full" or "isolcpus", the extra ones must have the same CPU list or the setup will fail partially. The HK_TYPE_DOMAIN and HK_TYPE_MANAGED_IRQ types are settable by "isolcpus" only and their settings can be independent of the other types. The other housekeeping types are all set by "nohz_full" or "isolcpus=3Dnohz" without a way to set them individually. So they all have identical cpumasks. There is actually no point in having different cpumasks for these "nohz_full" only housekeeping types. Consolidate these types to use the same cpumask by aliasing them to the same value. If there is a need to set any of them independently in the future, we can break them out to their own cpumasks again. With this change, the number of cpumasks in the housekeeping structure drops from 9 to 3. Other than that, there should be no other functional change. Signed-off-by: Waiman Long Acked-by: Frederic Weisbecker --- include/linux/sched/isolation.h | 20 +++++++++++++------- kernel/sched/isolation.c | 19 ++++++------------- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/include/linux/sched/isolation.h b/include/linux/sched/isolatio= n.h index 499d5e480882..d8501f4709b5 100644 --- a/include/linux/sched/isolation.h +++ b/include/linux/sched/isolation.h @@ -7,15 +7,21 @@ #include =20 enum hk_type { - HK_TYPE_TIMER, - HK_TYPE_RCU, - HK_TYPE_MISC, - HK_TYPE_TICK, HK_TYPE_DOMAIN, - HK_TYPE_WQ, HK_TYPE_MANAGED_IRQ, - HK_TYPE_KTHREAD, - HK_TYPE_MAX + HK_TYPE_KERNEL_NOISE, + HK_TYPE_MAX, + + /* + * The following housekeeping types are only set by the nohz_full + * boot commandline option. So they can share the same value. + */ + HK_TYPE_TICK =3D HK_TYPE_KERNEL_NOISE, + HK_TYPE_TIMER =3D HK_TYPE_KERNEL_NOISE, + HK_TYPE_RCU =3D HK_TYPE_KERNEL_NOISE, + HK_TYPE_MISC =3D HK_TYPE_KERNEL_NOISE, + HK_TYPE_WQ =3D HK_TYPE_KERNEL_NOISE, + HK_TYPE_KTHREAD =3D HK_TYPE_KERNEL_NOISE }; =20 #ifdef CONFIG_CPU_ISOLATION diff --git a/kernel/sched/isolation.c b/kernel/sched/isolation.c index 6a686322ce3c..81bc8b329ef1 100644 --- a/kernel/sched/isolation.c +++ b/kernel/sched/isolation.c @@ -9,14 +9,9 @@ */ =20 enum hk_flags { - HK_FLAG_TIMER =3D BIT(HK_TYPE_TIMER), - HK_FLAG_RCU =3D BIT(HK_TYPE_RCU), - HK_FLAG_MISC =3D BIT(HK_TYPE_MISC), - HK_FLAG_TICK =3D BIT(HK_TYPE_TICK), HK_FLAG_DOMAIN =3D BIT(HK_TYPE_DOMAIN), - HK_FLAG_WQ =3D BIT(HK_TYPE_WQ), HK_FLAG_MANAGED_IRQ =3D BIT(HK_TYPE_MANAGED_IRQ), - HK_FLAG_KTHREAD =3D BIT(HK_TYPE_KTHREAD), + HK_FLAG_KERNEL_NOISE =3D BIT(HK_TYPE_KERNEL_NOISE), }; =20 DEFINE_STATIC_KEY_FALSE(housekeeping_overridden); @@ -96,7 +91,7 @@ void __init housekeeping_init(void) =20 static_branch_enable(&housekeeping_overridden); =20 - if (housekeeping.flags & HK_FLAG_TICK) + if (housekeeping.flags & HK_FLAG_KERNEL_NOISE) sched_tick_offload_init(); =20 for_each_set_bit(type, &housekeeping.flags, HK_TYPE_MAX) { @@ -120,7 +115,7 @@ static int __init housekeeping_setup(char *str, unsigne= d long flags) unsigned int first_cpu; int err =3D 0; =20 - if ((flags & HK_FLAG_TICK) && !(housekeeping.flags & HK_FLAG_TICK)) { + if ((flags & HK_FLAG_KERNEL_NOISE) && !(housekeeping.flags & HK_FLAG_KERN= EL_NOISE)) { if (!IS_ENABLED(CONFIG_NO_HZ_FULL)) { pr_warn("Housekeeping: nohz unsupported." " Build with CONFIG_NO_HZ_FULL\n"); @@ -176,7 +171,7 @@ static int __init housekeeping_setup(char *str, unsigne= d long flags) housekeeping_setup_type(type, housekeeping_staging); } =20 - if ((flags & HK_FLAG_TICK) && !(housekeeping.flags & HK_FLAG_TICK)) + if ((flags & HK_FLAG_KERNEL_NOISE) && !(housekeeping.flags & HK_FLAG_KERN= EL_NOISE)) tick_nohz_full_setup(non_housekeeping_mask); =20 housekeeping.flags |=3D flags; @@ -194,8 +189,7 @@ static int __init housekeeping_nohz_full_setup(char *st= r) { unsigned long flags; =20 - flags =3D HK_FLAG_TICK | HK_FLAG_WQ | HK_FLAG_TIMER | HK_FLAG_RCU | - HK_FLAG_MISC | HK_FLAG_KTHREAD; + flags =3D HK_FLAG_KERNEL_NOISE; =20 return housekeeping_setup(str, flags); } @@ -214,8 +208,7 @@ static int __init housekeeping_isolcpus_setup(char *str) */ if (!strncmp(str, "nohz,", 5)) { str +=3D 5; - flags |=3D HK_FLAG_TICK | HK_FLAG_WQ | HK_FLAG_TIMER | - HK_FLAG_RCU | HK_FLAG_MISC | HK_FLAG_KTHREAD; + flags |=3D HK_FLAG_KERNEL_NOISE; continue; } =20 --=20 2.43.5 From nobody Sun Feb 8 00:26:12 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 BECEA84D02 for ; Sat, 21 Sep 2024 19:08:18 +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=1726945700; cv=none; b=D17jMxPmaVcGqR8pnz3FZRI+06FKEajj11vfJhzdI5hQ67IkW85FkIjttyDDA6frkQZoZ4ElET5h+6bPtYwHRhMYgntoYSVLV/3TV5naScEMQF+0y2hMoN9Nj9eUW+v2GthlgT8Fbrs1OlhQ+9cWrbt2oLgv2uZ9rw0zwrJdq98= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726945700; c=relaxed/simple; bh=I5z8KfkbyY6LrOPBboRcLTcgir1/WS/06RX1b/K8XPw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VPU5JaMUrLToqHq41UJnp9+iwJOTS/rwJ87NBYTJUwiabeijj/ODUibcEyJF8qbLZMHn1CCmZKX82sWqmnZXktIcWuRLkGpZRSMwRfHfazgr8VtafgIsp01wDTb+LW/MwmW/6ygfXs4MHpxw5aEnuKqOlG704k38X4gZgGSeURc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none 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=gI5L1tCu; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none 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="gI5L1tCu" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1726945697; 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=i+ujuK4NVoJhhXN+rtx0sM9reuyr8LRm8/o1/7F4LpU=; b=gI5L1tCuVivtTBJUPtsYZ2sGRo9Vgs36ZXZqKe5Dr7wqVh5nZgcPMQBRMk5o6H262wOFY6 Wjx1bExe0bjp3A9OLv6gMLs9wqrioSVYNMHmCLbVUnMCcv1vYsEbKFCgRc5wRFdWS0FN9a VKUVcrMC+g3UVd5/gBtkO+SxTdGBCTk= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-626-Ivkio_g0OWip3maM5fKmXQ-1; Sat, 21 Sep 2024 15:08:12 -0400 X-MC-Unique: Ivkio_g0OWip3maM5fKmXQ-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.12]) (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-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D2B701936B83; Sat, 21 Sep 2024 19:08:10 +0000 (UTC) Received: from llong.com (unknown [10.45.224.27]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 31C7919560AB; Sat, 21 Sep 2024 19:08:05 +0000 (UTC) From: Waiman Long To: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Frederic Weisbecker Cc: linux-kernel@vger.kernel.org, Phil Auld , Waiman Long Subject: [PATCH v4 4/4] sched: Unify HK_TYPE_{TIMER|TICK|MISC} to HK_TYPE_KERNEL_NOISE Date: Sat, 21 Sep 2024 15:07:20 -0400 Message-ID: <20240921190720.106195-5-longman@redhat.com> In-Reply-To: <20240921190720.106195-1-longman@redhat.com> References: <20240921190720.106195-1-longman@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.12 Content-Type: text/plain; charset="utf-8" As all the non-domain and non-managed_irq housekeeping types have been unified to HK_TYPE_KERNEL_NOISE, replace all these references in the scheduler to use HK_TYPE_KERNEL_NOISE. Signed-off-by: Waiman Long Acked-by: Frederic Weisbecker --- kernel/sched/core.c | 12 ++++++------ kernel/sched/fair.c | 5 +++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index a7af49b3a337..3412d0046d08 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -1114,13 +1114,13 @@ int get_nohz_timer_target(void) struct sched_domain *sd; const struct cpumask *hk_mask; =20 - if (housekeeping_cpu(cpu, HK_TYPE_TIMER)) { + if (housekeeping_cpu(cpu, HK_TYPE_KERNEL_NOISE)) { if (!idle_cpu(cpu)) return cpu; default_cpu =3D cpu; } =20 - hk_mask =3D housekeeping_cpumask(HK_TYPE_TIMER); + hk_mask =3D housekeeping_cpumask(HK_TYPE_KERNEL_NOISE); =20 guard(rcu)(); =20 @@ -1135,7 +1135,7 @@ int get_nohz_timer_target(void) } =20 if (default_cpu =3D=3D -1) - default_cpu =3D housekeeping_any_cpu(HK_TYPE_TIMER); + default_cpu =3D housekeeping_any_cpu(HK_TYPE_KERNEL_NOISE); =20 return default_cpu; } @@ -5526,7 +5526,7 @@ void sched_tick(void) unsigned long hw_pressure; u64 resched_latency; =20 - if (housekeeping_cpu(cpu, HK_TYPE_TICK)) + if (housekeeping_cpu(cpu, HK_TYPE_KERNEL_NOISE)) arch_scale_freq_tick(); =20 sched_clock_tick(); @@ -5652,7 +5652,7 @@ static void sched_tick_start(int cpu) int os; struct tick_work *twork; =20 - if (housekeeping_cpu(cpu, HK_TYPE_TICK)) + if (housekeeping_cpu(cpu, HK_TYPE_KERNEL_NOISE)) return; =20 WARN_ON_ONCE(!tick_work_cpu); @@ -5673,7 +5673,7 @@ static void sched_tick_stop(int cpu) struct tick_work *twork; int os; =20 - if (housekeeping_cpu(cpu, HK_TYPE_TICK)) + if (housekeeping_cpu(cpu, HK_TYPE_KERNEL_NOISE)) return; =20 WARN_ON_ONCE(!tick_work_cpu); diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index f76690c15bfe..08a3d024faf9 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -12208,7 +12208,7 @@ static inline int find_new_ilb(void) const struct cpumask *hk_mask; int ilb_cpu; =20 - hk_mask =3D housekeeping_cpumask(HK_TYPE_MISC); + hk_mask =3D housekeeping_cpumask(HK_TYPE_KERNEL_NOISE); =20 for_each_cpu_and(ilb_cpu, nohz.idle_cpus_mask, hk_mask) { =20 @@ -12226,7 +12226,8 @@ static inline int find_new_ilb(void) * Kick a CPU to do the NOHZ balancing, if it is time for it, via a cross-= CPU * SMP function call (IPI). * - * We pick the first idle CPU in the HK_TYPE_MISC housekeeping set (if the= re is one). + * We pick the first idle CPU in the HK_TYPE_KERNEL_NOISE housekeeping set + * (if there is one). */ static void kick_ilb(unsigned int flags) { --=20 2.43.5