From nobody Mon Nov 25 02:46:46 2024 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 299EF194138 for ; Wed, 30 Oct 2024 17:53:37 +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=1730310820; cv=none; b=k1ZIg7jI68hoE+cuqHdAy4UXj6ES/pVu3zWGCOx2iRbwJDfcU4WpkH+uncz6L5r2QRNiNqgNny1XbdBdYrxv5RrfGYvhugAQBBOw8ow2XUdrf+dz5zS0XpQpZQmfiEUtvFvmgC8Fexu1cPkXYkRwJVHziX+Nf0TLup7QUaxYuOo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730310820; c=relaxed/simple; bh=X77KITlwJmbdbWpDqkHXNwuU9228E2WwcmoO/xNvEHI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Y4MJXcz1CRCP2n+4wNEZfD1OFLffUturKfb2jOW445g9XjUaRIpgHK6x+DfbwQdvzmk7BLOOOPGaMyDzMReAVPOUDJPNwSM+cX/QGTvDwVn9kl36Ymt/bKbgTvDHrtpMwsly8MElbZFQAiQrHd1lnkj0ba4kvBBMbRx/EIcGnnk= 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=ise4C7d1; 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="ise4C7d1" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1730310817; 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=tzYePkSzdUHZxKhahOcUHMkyyEiJ4JD4O1Ou8UL6sUc=; b=ise4C7d1mGLrw6RHalbaM83u1U91lghxXvzos8qiWobUhnebbh2DFJosc5ZigvzW3av9F/ IgrmF0yIRSNJFkNKu9sx10b6qCMHhzjImUqq3kcHMcvS3UAbpsdzg6L6ssfTvNqrvFQexs nUuPQJ/f5V5Alz6s/clpWlwNb0GvhAI= 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-679-ouK1QbSSOq6o9TaAZNsK0g-1; Wed, 30 Oct 2024 13:53:36 -0400 X-MC-Unique: ouK1QbSSOq6o9TaAZNsK0g-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [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-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 800711955F45; Wed, 30 Oct 2024 17:53:34 +0000 (UTC) Received: from llong-thinkpadp16vgen1.westford.csb (unknown [10.22.81.200]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8C37B19560A2; Wed, 30 Oct 2024 17:53:31 +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: [RESEND PATCH v4 1/4] sched/core: Remove HK_TYPE_SCHED Date: Wed, 30 Oct 2024 13:52:50 -0400 Message-ID: <20241030175253.125248-2-longman@redhat.com> In-Reply-To: <20241030175253.125248-1-longman@redhat.com> References: <20240921190720.106195-1-longman@redhat.com> <20241030175253.125248-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 Mon Nov 25 02:46:46 2024 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 5F7D21F4274 for ; Wed, 30 Oct 2024 17:53:43 +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=1730310825; cv=none; b=UlAgETEYLHZAui6ldew5swKkEU1I4LbzQqfr9TUNsZ9LYvBGBm6s0wSOYSTOg/Xs9aAfHqH3nPgfLe6jAA9OH2ivM274HVaYqe3XgkUqg/0aI8eB2GLgCdfvKiXcHTg1KB8E6yzWb5hzUi83SAg77/QqGsOVAnKLq6spJXry8WM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730310825; c=relaxed/simple; bh=Xf7iaz7RhfEXsC2qbZz3r9uE1NWCdLczszPlMrhe9QQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TVrJEmCyQA7cHNHS546R6tIB7IFcpiDIbeyLqtVqH6L0Y0dtYmUtGroqnXyzk5P6HnG9/cMbAJW8RPrOy/SrE7oZ51y0yeEpZZSqBWDyajnqsa8XQgEFUjh+iLzymLkgtFT0LeVaOD5j+vZBY3FwyEl3TkyAOIvoe5cuJG3phys= 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=UecCXqic; 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="UecCXqic" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1730310822; 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=zPIKa2iNa6N9eFv3gPUxRMLqWm3wApOys5nqSpibaPM=; b=UecCXqicQOR1/hYK4M4rGltnj9e8jpueGQNi+Hrh/zep9CFhQmdORkwkQKWyB/4jb7O6gq rJlfXfg45cyb/9u32Dz62til8o4wTi/MnGrl8XQEIbAelQWEafMLRzMhhXNRJuBcq3rq/1 IsOxGoOezEzxEp2XpmJ70DV5ieGyu84= 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-647-XJh5WA6eNQqYjVLILXeEWw-1; Wed, 30 Oct 2024 13:53:39 -0400 X-MC-Unique: XJh5WA6eNQqYjVLILXeEWw-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [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 A53C919560BE; Wed, 30 Oct 2024 17:53:37 +0000 (UTC) Received: from llong-thinkpadp16vgen1.westford.csb (unknown [10.22.81.200]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C879A19560A7; Wed, 30 Oct 2024 17:53: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, Phil Auld , Waiman Long Subject: [RESEND PATCH v4 2/4] sched/isolation: Make "isolcpus=nohz" equivalent to "nohz_full" Date: Wed, 30 Oct 2024 13:52:51 -0400 Message-ID: <20241030175253.125248-3-longman@redhat.com> In-Reply-To: <20241030175253.125248-1-longman@redhat.com> References: <20240921190720.106195-1-longman@redhat.com> <20241030175253.125248-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 Mon Nov 25 02:46:46 2024 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 607A921313F for ; Wed, 30 Oct 2024 17:53: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=1730310829; cv=none; b=YwryR3y1QaPfh/iLQf5p9EnIxdBqtzmfEmf/Zuzu02sVHI5SU7LkLMgjsKqXAeODzsf2ujVD1Fs8G05WwZYXzQqdjuZSC0ywHz85t+c9m19Xdj7iJzPoaU6xMpW7QW/C1J0AqvR6z7FYhr9IO7aJkFgjaCZhn9j3Wm+Q7tmdplw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730310829; c=relaxed/simple; bh=yghUm+iCzQZWjznzIjU5ZpOutOU9ZOKU1YjDLNkq+7I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OxsRN4Oj7bB8xBcMQbgbkOSAcV07Psb/3fZL4h9MPCGDmaVov4MtuGP/XfmtwFj94w6mlhRVzRCAViL6RSF04fkV1fmlR//uKmAKpmZmhKGrGKvZt5cSLL5E7+uN2vnFLkz8KsAy02GrbsKH6OhDdVkYYMODzZTOtUZqmTRrv/U= 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=dw1kv51J; 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="dw1kv51J" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1730310826; 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=RCfJJQzrDJuV7NXoHO3WL1fpfNRacCThoNNgfJ3p6D8=; b=dw1kv51Jl5T+iQsW8Unoxvf9Sb8FgQyrAHcpe8/3g3uu0KgEfRuN0euB0cyzLGes9HlPaA muHo/E8hpwPH+iTMXCzwiemKltjqbvNncOIBD7O69TxLWwyL512sS5fZX/I8ULh0YkIL7p BTtMjDU+LUIuZszDsqpCl0cx9kvoz8Q= 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-209-AyZjmNOdPBqv5kguHeFt4w-1; Wed, 30 Oct 2024 13:53:42 -0400 X-MC-Unique: AyZjmNOdPBqv5kguHeFt4w-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [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 3853C1955F42; Wed, 30 Oct 2024 17:53:40 +0000 (UTC) Received: from llong-thinkpadp16vgen1.westford.csb (unknown [10.22.81.200]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id CFC8719560A2; Wed, 30 Oct 2024 17:53: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, Phil Auld , Waiman Long Subject: [RESEND PATCH v4 3/4] sched/isolation: Consolidate housekeeping cpumasks that are always identical Date: Wed, 30 Oct 2024 13:52:52 -0400 Message-ID: <20241030175253.125248-4-longman@redhat.com> In-Reply-To: <20241030175253.125248-1-longman@redhat.com> References: <20240921190720.106195-1-longman@redhat.com> <20241030175253.125248-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 Mon Nov 25 02:46:46 2024 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 17A511C9B77 for ; Wed, 30 Oct 2024 17:53:48 +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=1730310831; cv=none; b=MWgbF+s9wbY/R/j2sCiq/4bgqAykqyEEr9wr18FBsT8y0zdBVoqavE6qvbCom/rCR6+ilgDPU54tCZNtoqu1Su2N/eRggcbAqquYJX5azpfbBQIa+1nQjiOHxzWOgt/GAlmfrgD3jJN7ZmBGOqMTLiw1ZXhfEpnretp01Kf/8Ew= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730310831; c=relaxed/simple; bh=iqiLT7AoYtFh+txtnF/bx47h0urvK3MnoO68aMAsPxU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QZlvKqW9UCOcAqprbDeibILCc34bd6negsgIMIpBsiXD5aWhPF37BtU77nBypEP5IvR9LfxmcC2v5gYfdj0GKBHjvts7NTQ1jGz+6OKQBp9S8wuo5u0cUKXDdptbffeeGqIicSalFX0aHnUcIypoqF72qLMDy70v8+QXwV1HABs= 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=A6JUtBCf; 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="A6JUtBCf" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1730310828; 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=IB+fIq7UUdzE7rHEelrMfNY3WdXkdgYqJ24QIXo73+Q=; b=A6JUtBCfrYxOOvvFAVxSJswQMymATh6CFbd8oPkvtlDSDxQtPLhNHLIqfU78RU4sTQVibs U7bpUz1qZ6+qvM+djZpLqOrsc4YWe5wqyfIEXBTY/0ynfth+00Eu1nHOY1Uuu/Wu3qhqF5 CA1sb9ILitJaoxqSHsrgIy6GCDVClec= 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-63-ayc7AHyOPOGnbH4dc9afyw-1; Wed, 30 Oct 2024 13:53:44 -0400 X-MC-Unique: ayc7AHyOPOGnbH4dc9afyw-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [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 3EC351955F42; Wed, 30 Oct 2024 17:53:43 +0000 (UTC) Received: from llong-thinkpadp16vgen1.westford.csb (unknown [10.22.81.200]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7FE3A19560A2; Wed, 30 Oct 2024 17:53: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, Phil Auld , Waiman Long Subject: [RESEND PATCH v4 4/4] sched: Unify HK_TYPE_{TIMER|TICK|MISC} to HK_TYPE_KERNEL_NOISE Date: Wed, 30 Oct 2024 13:52:53 -0400 Message-ID: <20241030175253.125248-5-longman@redhat.com> In-Reply-To: <20241030175253.125248-1-longman@redhat.com> References: <20240921190720.106195-1-longman@redhat.com> <20241030175253.125248-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