From nobody Sat Feb 7 17:19:54 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 513AC155A24 for ; Sun, 18 Aug 2024 23:45:44 +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=1724024746; cv=none; b=ixykUHdHghanPOo7W1ab1D0cwiXwHj/+oxIPJym/lCeQVGY+c9u27WKW8/AvCOJV2SB/RivM2BIMY2wa4OH8Dpo7YAdBcK5uCf8mCs5qJ4aW/RAMfd+tZt7/2BugZ67A0WSZWwfFgUgCThFDXbnrAaBeyr/oSqYQ1XOY0IKUae8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724024746; c=relaxed/simple; bh=5GLJcx23yiK6O5h0SYqrBFpzEywtPryZurqS5veZTjs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=K6u1PK9MSDIWv3NzDIKzugcuD1aT8PdXXi8uDzsNW4A/7aiyR2F5nLOsdMilfXEmLzEXeeYSQAfExU7hOqqhOj0CYrkV7X3uQEM/nbA5OoxcMXcWd3ABk89tVkJDM+q6oCCfpLGUvvKYgBkuQXcdwD6jlnVfRwbNiwUffp63UQ8= 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=Pa/u5Dmz; 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="Pa/u5Dmz" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724024743; 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=UsNWp9LzBud4wrCMbUUSaGfMdSBqayoquJewiX+GBJw=; b=Pa/u5Dmz6BDXC6ydhXescE0tCAMijuOAzjHgwmKY99NdaAUIPOv1YeUjJ2/HKUfMX2Uth8 ScK2M9X7sQKazzdMQbxIb6F5jbbBaDvlOiqCzwUsKM0I2jrzEntxBh+P3E+AGEiKCQ2IfF 8lpUzw+pQl5qDiZR3an8SQaBErGTo8U= Received: from mx-prod-mc-04.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-1-7xNAUBQZNE6Vd42dqqL3_Q-1; Sun, 18 Aug 2024 19:45:39 -0400 X-MC-Unique: 7xNAUBQZNE6Vd42dqqL3_Q-1 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DD72219560B0; Sun, 18 Aug 2024 23:45:37 +0000 (UTC) Received: from llong.com (unknown [10.2.16.4]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C449E30001A4; Sun, 18 Aug 2024 23:45:34 +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, Waiman Long Subject: [PATCH 1/3] sched/isolation: Add HK_FLAG_SCHED to nohz_full Date: Sun, 18 Aug 2024 19:45:18 -0400 Message-ID: <20240818234520.90186-2-longman@redhat.com> In-Reply-To: <20240818234520.90186-1-longman@redhat.com> References: <20240818234520.90186-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.4.1 on 10.30.177.4 Content-Type: text/plain; charset="utf-8" The HK_FLAG_SCHED/HK_TYPE_SCHED flag is defined and is also used in kernel/sched/fair.c since commit de201559df87 ("sched/isolation: Introduce housekeeping flags"). However, the corresponding cpumask isn't currently updated anywhere. So the mask is always cpu_possible_mask. Add it in nohz_full setup so that nohz_full CPUs will now be removed from HK_TYPE_SCHED cpumask. Signed-off-by: Waiman Long --- kernel/sched/isolation.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/isolation.c b/kernel/sched/isolation.c index 5891e715f00d..a514994af319 100644 --- a/kernel/sched/isolation.c +++ b/kernel/sched/isolation.c @@ -196,7 +196,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; + HK_FLAG_MISC | HK_FLAG_KTHREAD | HK_FLAG_SCHED; =20 return housekeeping_setup(str, flags); } --=20 2.43.5 From nobody Sat Feb 7 17:19:54 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 04AA4156F3F for ; Sun, 18 Aug 2024 23:45:47 +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=1724024749; cv=none; b=FC2CqLas9zNLIqUCcSNtuEZdPJX92nfwclLMX26N1YPdhSGiv5zQ0M0SEJnPncGu3VW5f1y+jc/asF2tztiuKkx/CuQ0LGHV5DwVeKt7QkOSGbYWoJu0vZdrAPwHf8d1QJwW8UhY+46c8Dvpx+siNuNft05h2/EOxjhrhM9Uy6I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724024749; c=relaxed/simple; bh=K8N4sqRBO1QmisApM5o1j014BZ0JiNvo9k0GVZKy9Mk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dwAoTIpRGkUdqNCf48IvXsbeqLWXL1zkVsMPBkmik+n4jfrvFPKFmg4anY9gT7mu8wmuMxRHbJ47axatdvkn44p9QJF1x2LB7zYQMajDyNFrGYKT7krFz9Tnz9+cL5N5nb/HyFR3PaQp8SNNtusqyr7H5xvuF5QY/q+pOxOkhx4= 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=JsW4/DrK; 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="JsW4/DrK" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724024746; 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=/xTT9PXPTqZi64l2mdUMl7RWoFN2PRqSXvjmstfCL2M=; b=JsW4/DrKGty5EfK1au/BFl2Tc9DX6wovGow0CJD9KOeA7MX8Stl1ZagD7RXEPGDmTSl6Xp NbVgVmQyXgmvQxHGCkoW6Uq3cjE8hXWvw+x0GnxVHlX72pjs+WrWW+9SlppK5+hiWT5WnG OQAb90ueXyVM8G5yJaX8VAWdXQ673G4= Received: from mx-prod-mc-04.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-669-YRjt1jxCOEqJEzPC9NJdnw-1; Sun, 18 Aug 2024 19:45:42 -0400 X-MC-Unique: YRjt1jxCOEqJEzPC9NJdnw-1 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9E69219560AD; Sun, 18 Aug 2024 23:45:40 +0000 (UTC) Received: from llong.com (unknown [10.2.16.4]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E398130001A1; Sun, 18 Aug 2024 23:45:37 +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, Waiman Long Subject: [PATCH 2/3] sched/fair: Use HK_TYPE_SCHED housekeeping CPUs Date: Sun, 18 Aug 2024 19:45:19 -0400 Message-ID: <20240818234520.90186-3-longman@redhat.com> In-Reply-To: <20240818234520.90186-1-longman@redhat.com> References: <20240818234520.90186-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.4.1 on 10.30.177.4 Content-Type: text/plain; charset="utf-8" As the previous commit has enabled the setting of HK_TYPE_SCHED housekeeping CPUs in nohz_full setup, we can now use the more aptly named HK_TYPE_SCHED housekeeping CPUs instead of HK_TYPE_MISC. Signed-off-by: Waiman Long --- kernel/sched/fair.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 6be618110885..0350667f5ce8 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -12128,16 +12128,13 @@ 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) { const struct cpumask *hk_mask; int ilb_cpu; =20 - hk_mask =3D housekeeping_cpumask(HK_TYPE_MISC); + hk_mask =3D housekeeping_cpumask(HK_TYPE_SCHED); =20 for_each_cpu_and(ilb_cpu, nohz.idle_cpus_mask, hk_mask) { =20 @@ -12155,7 +12152,7 @@ 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_SCHED housekeeping set (if th= ere is one). */ static void kick_ilb(unsigned int flags) { --=20 2.43.5 From nobody Sat Feb 7 17:19:54 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 68F7E15820E for ; Sun, 18 Aug 2024 23:45:51 +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=1724024753; cv=none; b=KOkhGFoQ1UaWIctc0kMjKXlRyLUgvTiLLC8MgArZiyjl+WyCsjNueDFNcDu3e8IvLOXs3LKnGQUWbzkeKEyhkKn0aeUljgCybwsBq+AJFzVG1diQ+ilrd1NvwE7CbV96s8e1wkzcZPKXLnbyluZ/AtkdZVvmf1XEKnT84YI5gTI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724024753; c=relaxed/simple; bh=XOlQmKZDd/hS2AHZREtht9w0eGjuUONoLydr4hn+1iE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UOBdOzHwgOYhXKXeYfvJpTyhj81bwsBUCPoilb8Mc7ixWBa1nHAJBC898ihLkttp3WwX7x4nQIHp4aykIazB8zTCDdBbwzDQpnUWk3A/1MhNn359qK9KzaYIelVyb8ZD7ouItq49s3sWGHbPlDi+aqTsV6iZgXqnQIcmWDCVVnI= 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=N4mn+xtR; 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="N4mn+xtR" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724024750; 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=1XtqgvsLkkNoGss1scYw2thSuYRWAooGUrCtmGuXgX0=; b=N4mn+xtRRXLhNWIxqBjEAJlZn0xnB7BAp53MaxaYQv57fTmlUg3sIgzEthC60HrN2173ih s9dhp42/M+Ra/Wxhowo5p9GrMntCpYvjC1gM1AHSd/AqzwitKEJdCMLaVDbCMaYggUz+en uaJ/E4eZjLeK+IuTvmK02effXIkbGzQ= 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-482-Ov74qOUzNvq2X4sjS2qzzQ-1; Sun, 18 Aug 2024 19:45:44 -0400 X-MC-Unique: Ov74qOUzNvq2X4sjS2qzzQ-1 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 ECD871956095; Sun, 18 Aug 2024 23:45:42 +0000 (UTC) Received: from llong.com (unknown [10.2.16.4]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 88BE530001A4; Sun, 18 Aug 2024 23:45:40 +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, Waiman Long Subject: [PATCH 3/3] sched/isolation: Consolidate housekeeping cpumasks that are always identical Date: Sun, 18 Aug 2024 19:45:20 -0400 Message-ID: <20240818234520.90186-4-longman@redhat.com> In-Reply-To: <20240818234520.90186-1-longman@redhat.com> References: <20240818234520.90186-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.4.1 on 10.30.177.4 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 to have 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. Signed-off-by: Waiman Long --- include/linux/sched/isolation.h | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/include/linux/sched/isolation.h b/include/linux/sched/isolatio= n.h index 2b461129d1fa..da32b502f0c6 100644 --- a/include/linux/sched/isolation.h +++ b/include/linux/sched/isolation.h @@ -7,15 +7,22 @@ #include =20 enum hk_type { - HK_TYPE_TIMER, - HK_TYPE_RCU, - HK_TYPE_MISC, - HK_TYPE_SCHED, HK_TYPE_TICK, HK_TYPE_DOMAIN, - HK_TYPE_WQ, HK_TYPE_MANAGED_IRQ, - HK_TYPE_KTHREAD, + HK_TYPE_NOHZ_FULL, + + /* + * 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_NOHZ_FULL, + HK_TYPE_RCU =3D HK_TYPE_NOHZ_FULL, + HK_TYPE_MISC =3D HK_TYPE_NOHZ_FULL, + HK_TYPE_SCHED =3D HK_TYPE_NOHZ_FULL, + HK_TYPE_WQ =3D HK_TYPE_NOHZ_FULL, + HK_TYPE_KTHREAD =3D HK_TYPE_NOHZ_FULL, + HK_TYPE_MAX }; =20 --=20 2.43.5