From nobody Fri Dec 19 16:43:50 2025 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 016BD1E1A2F for ; Wed, 4 Sep 2024 18:37:08 +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=1725475030; cv=none; b=bHUpActy2XxrzEGRl+/ntneIm/lSJVSl+4jcmPlvnXjty0zaNZMhikaj7VBgu7y9eXlIqVQI8H7/EF+zPw5j/ia6CZvE7W9vEdoALhNLTqXIPwgMkT8XBKDURXP43Nh1dOKLc/jzTP5lcXWaMtBvEOPlYwM+t6Z+Cr4SVnyEti0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725475030; c=relaxed/simple; bh=Wau/q+35GYpxQ+DMRtXpevDS07OwHE6batl31i3kT7s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JuXodvr+xYOa5HNIOxYFAGE6ZKh2ZI9WhjSBio4ICewlLRHN4McFshIEkY4HuE+OWW73GkZWlMUXZXs7+Z8vgqT2Tx6GnOP45r8NjQiQbACDa5tpRli4PmoxqHg1I+aQpEXUxoX4hcDjnwHHFrDdK5c/l70KZSTNIq1UDICcs9I= 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=WTQtbYh7; 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="WTQtbYh7" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725475027; 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=CWMJPGHHsyqwh2jeUcl0baof59j2hw5GpcL0saOPeyM=; b=WTQtbYh7pFe01sIlinAqsbE3KFv76bwbrtk0qa5VKYc5Bb5lPa3VnQ9B7e+8cjNr88ITq5 EKaicJZFJ0FvVrbWxhI7DUi5BufjfE7JR3rX2WiZJ0S2gCIOfOonqP8ahVvmH6U1tH4LPh 7XGmAQeFoYNW24w652GAu6Al68WGykU= 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-37-8U5-aTYWO7-g5Dr8FPgKPw-1; Wed, 04 Sep 2024 14:37:03 -0400 X-MC-Unique: 8U5-aTYWO7-g5Dr8FPgKPw-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (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 6D26D1953959; Wed, 4 Sep 2024 18:37:01 +0000 (UTC) Received: from llong.com (unknown [10.2.16.172]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D65AF1955D44; Wed, 4 Sep 2024 18:36:58 +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 v3 1/2] sched/core: Remove HK_TYPE_SCHED Date: Wed, 4 Sep 2024 14:36:49 -0400 Message-ID: <20240904183650.1053708-2-longman@redhat.com> In-Reply-To: <20240904183650.1053708-1-longman@redhat.com> References: <20240904183650.1053708-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.40 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 --- 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 9057584ec06d..ac5ed846fb55 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -11840,9 +11840,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) { @@ -12087,10 +12084,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 @@ -12310,13 +12303,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 Fri Dec 19 16:43:50 2025 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 331951E2039 for ; Wed, 4 Sep 2024 18:37:10 +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=1725475032; cv=none; b=JdoJ2jqgFfNkSTJDde9HGXiRAzcPHkJkrtiz0GAq8b3NjdbICuUiYfar12H49UuDc1fJlYF1tZ+uBhtOOW4QLbnafxwg0J8MWxLhQ5EhzZ0P2ysoR/XJ35UODhIvvZXVz/o/gmOs8xULCihJECGhCBttuhdMDUoyqkcuwGjUUFc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725475032; c=relaxed/simple; bh=Qz1oHXsGRvkul0CPue8xzPHrcvGU8z6RPHX1YAy5KnY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WhBPT2MdfDxVa2pZtvBeur7roPIIIgebWHMoaeoq+NcM0no/eQ4+J6bkoDZ2t4g1FP/aBzAGMMPrD0sxGya0xS9dQfLBCFMejaHJSUCWfRZ+i8jvPnEJnErwSVGNfUQPKQ6XToW/GtfZhCrx9rBVoc61wBfYgE48ASjLOx1df1M= 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=Xa+q0e7S; 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="Xa+q0e7S" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725475030; 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=H5gC7elI8FcKQ992DZVgo/TSNWN3fufuNC65WmyMao8=; b=Xa+q0e7S2zvzH9Vkwd9GlMhwC6W7uQs2Bz6jN3lb/E25F7APVSgiB5/xvsI/waxuS7jQC8 Lut9NgOZqITPpLKirCwS6Mo0fEHyT/Sfje2XivMR4CkH12sAYF5jX78NatrrEEPxGQTjHF 2Y/nWq7U1v1k/j0wj1QtNaE98u3/d0Y= 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-668-qtzUgY4DPESSsuF5uZbl5g-1; Wed, 04 Sep 2024 14:37:05 -0400 X-MC-Unique: qtzUgY4DPESSsuF5uZbl5g-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (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 42B651955F07; Wed, 4 Sep 2024 18:37:04 +0000 (UTC) Received: from llong.com (unknown [10.2.16.172]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 749B51955F45; Wed, 4 Sep 2024 18:37:01 +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 v3 2/2] sched/isolation: Consolidate housekeeping cpumasks that are always identical Date: Wed, 4 Sep 2024 14:36:50 -0400 Message-ID: <20240904183650.1053708-3-longman@redhat.com> In-Reply-To: <20240904183650.1053708-1-longman@redhat.com> References: <20240904183650.1053708-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.40 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_TICK, HK_TYPE_DOMAIN and HK_TYPE_MANAGED_IRQ types are settable by "isolcpus" and they can be set individually. The other housekeeping types are all set by "nohz_full" 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 4. There is no other functional change. Signed-off-by: Waiman Long --- include/linux/sched/isolation.h | 18 ++++++++++++------ kernel/sched/isolation.c | 9 ++------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/include/linux/sched/isolation.h b/include/linux/sched/isolatio= n.h index 499d5e480882..e2c42172de82 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_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 5345e11f3d44..61d0f97341c3 100644 --- a/kernel/sched/isolation.c +++ b/kernel/sched/isolation.c @@ -9,14 +9,10 @@ */ =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); @@ -194,8 +190,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_TICK | HK_FLAG_KERNEL_NOISE; =20 return housekeeping_setup(str, flags); } --=20 2.43.5