From nobody Sun Feb 8 18:27:22 2026 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2CFBD6BFC9 for ; Fri, 1 Mar 2024 11:09:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709291401; cv=none; b=Sypj9bUhraZG1YGkft5fHIoTSXZelUYzb5JRPfiZX/dT5CaNQ/H0JIEJ7jennwXBTMHSpBM8jIVKvVEtGyEkeorvsBDkniw86umk5+OY/p3+v2JcCa+G6giSkOuuf7gQEURvxBpAb6AILmadrfyZGFNdoyN4nDxzi995Qoo6tFw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709291401; c=relaxed/simple; bh=NL0X0BOz7ZVywJyCc8r0y4XYQQ5/b+5FbeyYJW/2ZGY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=CmiTcpc10ZG68EMACXkMYnre6mc6wOS0/Q+slAcPxFbsAGsxwbyLUS/vBtPo1pj4T8BS1tQqHYF5SpFH6Sp1TNc9SwUgiar+/ZXXFuPMqcY5O5xDmpIrWJLOkUPBJxGJj/UrGYLdnKW2xplYPKG+31dcVcFI/Yqq5d9iBXr9R/8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=TbFKmpd4; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TbFKmpd4" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-412a9e9c776so18625105e9.0 for ; Fri, 01 Mar 2024 03:09:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709291397; x=1709896197; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=PRfa5V1eCtQKvE35o3iYx+TIdATo30V6vBwFI6v4hE8=; b=TbFKmpd4+yaZTeo1bSuDisQWTqe7TJoUlSZeQ901Mc12vtk4b9UvMUypBBQZxOG28P uQuKIKQOl1RvI3kHa9QDez1jo8HF1CX58MBRJJWIyLI41QACZKi+wWuKrPtY/kI3Puso uofkgtS66ATQEZNkF4nlPcoq72O16E9aH/CH3Dms6L3fsE5IKkY6RnwCz9klYXUOB5JM mSmYx5UrM0Sw/JMjywxMN8X0hTiHMNvSK2ffvuJrCVPboQgM9X6EmBeDgYf5BpebWlHQ 1epxAKhEOTH1vHaIMFctj2OCUIGpW5EhpYy/hItt4c9Xmw57xjVV/TcA5L13Y10NpB0w nmKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709291397; x=1709896197; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=PRfa5V1eCtQKvE35o3iYx+TIdATo30V6vBwFI6v4hE8=; b=mzpZBbkdeZTQXeMYvjMdffjlnhwEg+h5GRS3SduqVksHCzgul9WV0Me6gpdajR3uJc HTFqjwF8a4JFmvPidLXRq6d6nBVO4BmpmErXvu/lA4uK2OmdPhxfVwL/qN5las+yEB2B rBVDK5ImZKBFpEbFudk2m1ON/9fO/UyzUyJUemXGde5y300hUQiFybhVRqxINzwVdc7J KPoVHznYafL8p7ieKXT7n+I8gAk9y90jUfAvonSHtf8pnNYI7xPPQZWDdYVu0MlmzHPQ S3TgrlRI0iZ21vCbIlO6gh0h65L9P5gFyub6FXVlEdgxF+QgRkyXwh8LCDowlKbf6/91 V1yw== X-Gm-Message-State: AOJu0Yw1Jf1AeXsMFlfV75OcUu4xQmDMnRoWavBWKPczqNfT5v16sy7S IfiTcdG+BBHkbR5zNBerz2qDd5o3SHSY55+ptlINOXXHl39Gliva0EPa9/1E8qM= X-Google-Smtp-Source: AGHT+IGiJ2USHyCH/RfQda37Ym4O9RsMrvKdzLVxNbbICBgCvKkfRS4AATBIZsdjCzTrO1XyHeiBRA== X-Received: by 2002:a05:600c:1c28:b0:412:b6a7:ecf1 with SMTP id j40-20020a05600c1c2800b00412b6a7ecf1mr1507519wms.0.1709291397207; Fri, 01 Mar 2024 03:09:57 -0800 (PST) Received: from kepler.redhat.com (1F2EF13F.nat.pool.telekom.hu. [31.46.241.63]) by smtp.gmail.com with ESMTPSA id b20-20020a05600c4e1400b00412cad66f8fsm490264wmq.44.2024.03.01.03.09.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 03:09:56 -0800 (PST) Sender: Ingo Molnar From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Linus Torvalds , Valentin Schneider Subject: [PATCH 1/7] sched/balancing: Switch the 'DEFINE_SPINLOCK(balancing)' spinlock into an 'atomic_t sched_balance_running' flag Date: Fri, 1 Mar 2024 12:09:45 +0100 Message-Id: <20240301110951.3707367-2-mingo@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240301110951.3707367-1-mingo@kernel.org> References: <20240301110951.3707367-1-mingo@kernel.org> 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 Content-Type: text/plain; charset="utf-8" The 'balancing' spinlock added in: 08c183f31bdb ("[PATCH] sched: add option to serialize load balancing") ... is taken when the SD_SERIALIZE flag is set in a domain, but in reality = it is a glorified global atomic flag serializing the load-balancing of those domains. It doesn't have any explicit locking semantics per se: we just spin_trylock() it. Turn it into a ... global atomic flag. This makes it more clear what is going on here, and reduces overhead and code size a bit: # kernel/sched/fair.o: [x86-64 defconfig] text data bss dec hex filename 60730 2721 104 63555 f843 fair.o.before 60718 2721 104 63543 f837 fair.o.after Also document the flag a bit. No change in functionality intended. Signed-off-by: Ingo Molnar Cc: Peter Zijlstra Cc: Vincent Guittot Cc: Dietmar Eggemann Cc: Linus Torvalds Cc: Valentin Schneider --- kernel/sched/fair.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 6a16129f9a5c..64ae3d8dc93b 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -11633,7 +11633,20 @@ static int active_load_balance_cpu_stop(void *data) return 0; } =20 -static DEFINE_SPINLOCK(balancing); +/* + * This flag serializes load-balancing passes over large domains + * (such as SD_NUMA) - only once load-balancing instance may run + * at a time, to reduce overhead on very large systems with lots + * of CPUs and large NUMA distances. + * + * - Note that load-balancing passes triggered while another one + * is executing are skipped and not re-tried. + * + * - Also note that this does not serialize sched_balance_domains() + * execution, as non-SD_SERIALIZE domains will still be + * load-balanced in parallel. + */ +static atomic_t sched_balance_running =3D ATOMIC_INIT(0); =20 /* * Scale the max load_balance interval with the number of CPUs in the syst= em. @@ -11711,7 +11724,7 @@ static void rebalance_domains(struct rq *rq, enum c= pu_idle_type idle) =20 need_serialize =3D sd->flags & SD_SERIALIZE; if (need_serialize) { - if (!spin_trylock(&balancing)) + if (atomic_cmpxchg_acquire(&sched_balance_running, 0, 1)) goto out; } =20 @@ -11729,7 +11742,7 @@ static void rebalance_domains(struct rq *rq, enum c= pu_idle_type idle) interval =3D get_sd_balance_interval(sd, busy); } if (need_serialize) - spin_unlock(&balancing); + atomic_set_release(&sched_balance_running, 0); out: if (time_after(next_balance, sd->last_balance + interval)) { next_balance =3D sd->last_balance + interval; --=20 2.40.1 From nobody Sun Feb 8 18:27:22 2026 Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 609F96BFD4 for ; Fri, 1 Mar 2024 11:10:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709291402; cv=none; b=gq5E6s0eFjNxCx9SvQYtmMKx4EQiSJLe5JQBc527RkBlUpwmM525w2YfWmtidIpchX6O9dJvux5dQ5CtqJ+FrS8bwyrsuusRe1/DaNh7dWdqVHVbXrB9NWnfCyV1JVVFSpSEX4kaMIEG/WNPyo0M9Um4IilKAdZZEMSENLjj4ZQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709291402; c=relaxed/simple; bh=wGnnv0R/i5/PFNWqQGKADyW9AWcXKqVYmEaB4jhEARo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=DS9AfkOUmaohriF5p75lHQqRSIvKJrvGztOkgaA9ZMSZXUKSL/Y/FGD0VfuhZsqgcFUq8HYivwyYP09kIvXDWkX4WetZPlmSNb7zuK2XLxzgMnZJXyJPekOUfE+vOrEmmHQjrNPNf3VHvjmXfM/ZUkyoAb3YrdohynZz0M896AQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Vh97PiU1; arc=none smtp.client-ip=209.85.167.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Vh97PiU1" Received: by mail-lf1-f43.google.com with SMTP id 2adb3069b0e04-5131f3fc695so2055467e87.1 for ; Fri, 01 Mar 2024 03:10:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709291398; x=1709896198; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=tqL84XLNVn0Cp5LtqkDs2ZJplR67S7lT/DN/daWYchI=; b=Vh97PiU1PGM9Bp9jBhkg+LDjmTR0z1kZWEYY9IYMAD/KXJ711X20hfu4aP2bg7f+0B VKua4AOUlPn3ohOMuoxa/Ik/faD72WpTkRpp2KvfuOiOS4ZvE3KlR9kEfjbe4ZnXSw4v JM2pn4+gaIvSjwUNj9YQFCNVylyZYoiH2rAV/depH2RjCwtpsw6jXiOsdR9sxHpwEMgD Y/l1u0RXGN1N9sThTmo/tCoasGmqpsetKMdHKXVagnNtSOEacM45eytoaUPCBEMp5XOD GAxrq8y0iyBkabzoumH9uqaaRXsD33/jqJbW9/l27jv5h2iciLLH8T7f0eKAfMY5XMcD jhYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709291398; x=1709896198; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=tqL84XLNVn0Cp5LtqkDs2ZJplR67S7lT/DN/daWYchI=; b=rmMJBQX55BY61EEikTiaiuR9KpM2+zBL+OCLoaQRuv3H7fxZ9Thq57xeLkF41EX6hv U/3TrjrRV5s1Y4ALgpCx3juYYhEXixO4SAwQ9lx6FXxosinJU49sLsfPUfBi/DkzawRS 226E+Rgt5GE3/ExTeaCaWVLetJqOg0zqeRyRo5I3uXWHMUK1/JUZPhLRhs57juhneaRY SMC92p8LdjnVGLcb0NvukQcG84HCapzfK/j3b9azKywDUWZwaqYU3pGwre8ur/X5y4HH uk22753XHK8o7oomA+GCE3tJBrjzzI4k6IG8eKc+OgGvkFzeQW/YiV5rVsywRU0STjp4 7yLg== X-Gm-Message-State: AOJu0Yy44fuoCcVjvq9XCuUosVLHnWRfENgyGUXKOMS3OYaaZn6tI793 1ghRnCKf1K2bSJUYlj7Ir+QRgp1uYcIJ3X2/U7s/d+geHsaiePSVvNE7sVii1mA= X-Google-Smtp-Source: AGHT+IHupKWUY0EdwZIbjZg9mZUJXRc76nqyTBVtIc99+Q5/S+2RV61Oo6zZSnfGYuAUSvDkvRgwJQ== X-Received: by 2002:ac2:5199:0:b0:513:1a9c:ae77 with SMTP id u25-20020ac25199000000b005131a9cae77mr896636lfi.52.1709291398405; Fri, 01 Mar 2024 03:09:58 -0800 (PST) Received: from kepler.redhat.com (1F2EF13F.nat.pool.telekom.hu. [31.46.241.63]) by smtp.gmail.com with ESMTPSA id b20-20020a05600c4e1400b00412cad66f8fsm490264wmq.44.2024.03.01.03.09.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 03:09:57 -0800 (PST) Sender: Ingo Molnar From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Linus Torvalds , Valentin Schneider Subject: [PATCH 2/7] sched/balancing: Change 'enum cpu_idle_type' to have more natural definitions Date: Fri, 1 Mar 2024 12:09:46 +0100 Message-Id: <20240301110951.3707367-3-mingo@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240301110951.3707367-1-mingo@kernel.org> References: <20240301110951.3707367-1-mingo@kernel.org> 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 Content-Type: text/plain; charset="utf-8" The cpu_idle_type enum has the confusingly inverted property that 'not idle' is 1, and 'idle' is '0'. This resulted in a number of unnecessary complications in the code. Reverse the order, remove the CPU_NOT_IDLE type, and convert all code to a natural boolean form. It's much more readable: - enum cpu_idle_type idle =3D this_rq->idle_balance ? - CPU_IDLE : CPU_NOT_IDLE; - + enum cpu_idle_type idle =3D this_rq->idle_balance; -------------------------------- - if (env->idle =3D=3D CPU_NOT_IDLE || !busiest->sum_nr_running) + if (!env->idle || !busiest->sum_nr_running) -------------------------------- And gets rid of the double negation in these usages: - if (env->idle !=3D CPU_NOT_IDLE && env->src_rq->nr_runnin= g <=3D 1) + if (env->idle && env->src_rq->nr_running <=3D 1) Furthermore, this makes code much more obvious where there's differentiation between CPU_IDLE and CPU_NEWLY_IDLE. Signed-off-by: Ingo Molnar Cc: Peter Zijlstra Cc: Vincent Guittot Cc: Dietmar Eggemann Cc: Linus Torvalds Cc: Valentin Schneider --- include/linux/sched/idle.h | 3 +-- kernel/sched/fair.c | 27 ++++++++++++--------------- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/include/linux/sched/idle.h b/include/linux/sched/idle.h index 478084f9105e..4a6423700ffc 100644 --- a/include/linux/sched/idle.h +++ b/include/linux/sched/idle.h @@ -5,8 +5,7 @@ #include =20 enum cpu_idle_type { - CPU_IDLE, - CPU_NOT_IDLE, + CPU_IDLE =3D 1, CPU_NEWLY_IDLE, CPU_MAX_IDLE_TYPES }; diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 64ae3d8dc93b..f11fc6dd39b1 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -9070,7 +9070,7 @@ static int detach_tasks(struct lb_env *env) * We don't want to steal all, otherwise we may be treated likewise, * which could at worst lead to a livelock crash. */ - if (env->idle !=3D CPU_NOT_IDLE && env->src_rq->nr_running <=3D 1) + if (env->idle && env->src_rq->nr_running <=3D 1) break; =20 env->loop++; @@ -9803,7 +9803,7 @@ static inline bool smt_vs_nonsmt_groups(struct sched_= group *sg1, static inline bool smt_balance(struct lb_env *env, struct sg_lb_stats *sgs, struct sched_group *group) { - if (env->idle =3D=3D CPU_NOT_IDLE) + if (!env->idle) return false; =20 /* @@ -9827,7 +9827,7 @@ static inline long sibling_imbalance(struct lb_env *e= nv, int ncores_busiest, ncores_local; long imbalance; =20 - if (env->idle =3D=3D CPU_NOT_IDLE || !busiest->sum_nr_running) + if (!env->idle || !busiest->sum_nr_running) return 0; =20 ncores_busiest =3D sds->busiest->cores; @@ -9927,8 +9927,7 @@ static inline void update_sg_lb_stats(struct lb_env *= env, sgs->group_misfit_task_load =3D rq->misfit_task_load; *sg_status |=3D SG_OVERLOAD; } - } else if ((env->idle !=3D CPU_NOT_IDLE) && - sched_reduced_capacity(rq, env->sd)) { + } else if (env->idle && sched_reduced_capacity(rq, env->sd)) { /* Check for a task running on a CPU with reduced capacity */ if (sgs->group_misfit_task_load < load) sgs->group_misfit_task_load =3D load; @@ -9940,7 +9939,7 @@ static inline void update_sg_lb_stats(struct lb_env *= env, sgs->group_weight =3D group->group_weight; =20 /* Check if dst CPU is idle and preferred to this group */ - if (!local_group && env->idle !=3D CPU_NOT_IDLE && sgs->sum_h_nr_running = && + if (!local_group && env->idle && sgs->sum_h_nr_running && sched_group_asym(env, sgs, group)) sgs->group_asym_packing =3D 1; =20 @@ -10698,7 +10697,7 @@ static inline void calculate_imbalance(struct lb_en= v *env, struct sd_lb_stats *s * waiting task in this overloaded busiest group. Let's * try to pull it. */ - if (env->idle !=3D CPU_NOT_IDLE && env->imbalance =3D=3D 0) { + if (env->idle && env->imbalance =3D=3D 0) { env->migration_type =3D migrate_task; env->imbalance =3D 1; } @@ -10913,7 +10912,7 @@ static struct sched_group *find_busiest_group(struc= t lb_env *env) goto force_balance; =20 if (busiest->group_type !=3D group_overloaded) { - if (env->idle =3D=3D CPU_NOT_IDLE) { + if (!env->idle) { /* * If the busiest group is not overloaded (and as a * result the local one too) but this CPU is already @@ -11121,7 +11120,7 @@ asym_active_balance(struct lb_env *env) * the lower priority @env::dst_cpu help it. Do not follow * CPU priority. */ - return env->idle !=3D CPU_NOT_IDLE && sched_use_asym_prio(env->sd, env->d= st_cpu) && + return env->idle && sched_use_asym_prio(env->sd, env->dst_cpu) && (sched_asym_prefer(env->dst_cpu, env->src_cpu) || !sched_use_asym_prio(env->sd, env->src_cpu)); } @@ -11159,7 +11158,7 @@ static int need_active_balance(struct lb_env *env) * because of other sched_class or IRQs if more capacity stays * available on dst_cpu. */ - if ((env->idle !=3D CPU_NOT_IDLE) && + if (env->idle && (env->src_rq->cfs.h_nr_running =3D=3D 1)) { if ((check_cpu_capacity(env->src_rq, sd)) && (capacity_of(env->src_cpu)*sd->imbalance_pct < capacity_of(env->dst_= cpu)*100)) @@ -11735,8 +11734,8 @@ static void rebalance_domains(struct rq *rq, enum c= pu_idle_type idle) * env->dst_cpu, so we can't know our idle * state even if we migrated tasks. Update it. */ - idle =3D idle_cpu(cpu) ? CPU_IDLE : CPU_NOT_IDLE; - busy =3D idle !=3D CPU_IDLE && !sched_idle_cpu(cpu); + idle =3D idle_cpu(cpu); + busy =3D !idle && !sched_idle_cpu(cpu); } sd->last_balance =3D jiffies; interval =3D get_sd_balance_interval(sd, busy); @@ -12416,9 +12415,7 @@ static int newidle_balance(struct rq *this_rq, stru= ct rq_flags *rf) static __latent_entropy void run_rebalance_domains(struct softirq_action *= h) { struct rq *this_rq =3D this_rq(); - enum cpu_idle_type idle =3D this_rq->idle_balance ? - CPU_IDLE : CPU_NOT_IDLE; - + enum cpu_idle_type idle =3D this_rq->idle_balance; /* * If this CPU has a pending nohz_balance_kick, then do the * balancing on behalf of the other idle CPUs whose ticks are --=20 2.40.1 From nobody Sun Feb 8 18:27:22 2026 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6485C6CBF7 for ; Fri, 1 Mar 2024 11:10:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709291403; cv=none; b=EGIrWIjknGiN5PlaHZL1YThM80VD8eDRvfke2s+e1VIIknG3vEnDpyPSQ+PuOJLsTf2ipOQEAMoBuWPdkuDDsijp6WkDrYDDlzRnELzaVdI8enXxeF+TRNdWtssihGsoFtbNcLad28aE99h8j430ILlyQ8w9S1rHxFObCL4Qrzo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709291403; c=relaxed/simple; bh=25qFObja4ZHXiwqUDbfSYr1EcpHvXYlwGZ9JseGR6EI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=eEWC1n3Qcwj72fRHZIUbNuSf183yQjgy46AnR7ItfmxhexNzS4fX0wU4tfcAEbxXSDta6f1Aub6vtXUpwo9v3eOPFPbeZdLNEf9/tiSZwCCvvIm4UdSqKTV3G9rBOynVnvif6i/ICKBRjwh/63BRGXvUjFBEsEmFgEkXP7dDFkM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=RgGBW+5g; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RgGBW+5g" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-412b83cfb44so13122075e9.3 for ; Fri, 01 Mar 2024 03:10:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709291400; x=1709896200; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=m8fTQ+F8wbIR0pBCZ90+DSUH9EydgL03eONGv2AQpFQ=; b=RgGBW+5gtuYht/xRdLIpgr8Fajx4QQZ/HwNoCZRYO3tod0I8pYe9uIgCA0xo8LwwYw IeLuY0Td3LK6slawfIvmioVLkgWifGhGVJ5Fhu3lq55+Iqxcyog7BrgvCjFYpdq89CRG g3X1gE+wh6b7ZuD6YQF0v2LpoG65cgy3B6r+vrWslLL9N/jiew3MORceNCzzrxSh/kD6 UNZ51pNGu10CON7gKphmdWlJ8cjNmx5wuQusgY7jw8iayk54e8vemv1ydBLEzYZkDRGo qdZRt8yXlUaf/5bj4O+GO4DHaUxF39dMh0LiITBlmfPw69PYt7E8/ItdOEX/069JGcTU 4LPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709291400; x=1709896200; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=m8fTQ+F8wbIR0pBCZ90+DSUH9EydgL03eONGv2AQpFQ=; b=IW/2m//5DKXi9+T2u6BPRFGQ9lDKy27mJcWDzJZ7wm01xJm/IzyyOQPGVvdU2PUblm hWTfA+pTUl81uf443RMfxNPmKu/+l9z3iifTwRmqec3NVufjWvoD9ylTf8wQiChuy+LQ f7yOFMISh+rS3VsHHkSaKbvT6V5416A8qok1YOmAcBHoeCI0+C0YoxrnPicl5TTw9Co/ YQfkwciwJZ8IFN8huGwYAqyxMk0oiZPWwQx6DlBrYgIiGt/B1GtJagUxLpHW+7qACbM5 sKQl3M7MLyBk+i/qfklmTT2QYpN1tmiXVUm1qWTHkyr+NOViP1c8/t0ZsYwVC4z+GkFz wPqA== X-Gm-Message-State: AOJu0Ywo3V7wy0aRlMxytfSKe0amfevij/l8hTIzR7viiNkdYuxkbb23 8RLBkAnEWwOW/LLfj6Y0zlJvrOI4Pww8waDOaQ4ZOlzpFY2p8CtQ28rNsNw7nM4= X-Google-Smtp-Source: AGHT+IHNDisWXxf+gqRVuS6xPxgcP7j2PAo3PCTzuFEvXmvHeZRueUpjcjFQdDDMhIpB/EnOxBIKWw== X-Received: by 2002:a05:600c:4e11:b0:412:c855:b5b7 with SMTP id b17-20020a05600c4e1100b00412c855b5b7mr1103993wmq.21.1709291399512; Fri, 01 Mar 2024 03:09:59 -0800 (PST) Received: from kepler.redhat.com (1F2EF13F.nat.pool.telekom.hu. [31.46.241.63]) by smtp.gmail.com with ESMTPSA id b20-20020a05600c4e1400b00412cad66f8fsm490264wmq.44.2024.03.01.03.09.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 03:09:58 -0800 (PST) Sender: Ingo Molnar From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Linus Torvalds , Valentin Schneider Subject: [PATCH 3/7] sched/balancing: Change comment formatting to not overlap Git conflict marker lines Date: Fri, 1 Mar 2024 12:09:47 +0100 Message-Id: <20240301110951.3707367-4-mingo@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240301110951.3707367-1-mingo@kernel.org> References: <20240301110951.3707367-1-mingo@kernel.org> 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 Content-Type: text/plain; charset="utf-8" So the scheduler has two such comment blocks, with '=3D' used as a double u= nderline: /* * VRUNTIME * =3D=3D=3D=3D=3D=3D=3D=3D * '=3D=3D=3D=3D=3D=3D=3D=3D' also happens to be a Git conflict marker, throwi= ng off a simple search in an editor for this pattern. Change them to '-------' type of underline instead - it looks just as good. Signed-off-by: Ingo Molnar Cc: Peter Zijlstra Cc: Vincent Guittot Cc: Dietmar Eggemann Cc: Linus Torvalds Cc: Valentin Schneider --- kernel/sched/fair.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index f11fc6dd39b1..934ace69eb30 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -3679,7 +3679,7 @@ static void reweight_eevdf(struct cfs_rq *cfs_rq, str= uct sched_entity *se, =20 /* * VRUNTIME - * =3D=3D=3D=3D=3D=3D=3D=3D + * -------- * * COROLLARY #1: The virtual runtime of the entity needs to be * adjusted if re-weight at !0-lag point. @@ -3762,7 +3762,7 @@ static void reweight_eevdf(struct cfs_rq *cfs_rq, str= uct sched_entity *se, =20 /* * DEADLINE - * =3D=3D=3D=3D=3D=3D=3D=3D + * -------- * * When the weight changes, the virtual time slope changes and * we should adjust the relative virtual deadline accordingly. --=20 2.40.1 From nobody Sun Feb 8 18:27:22 2026 Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 516E16CDAF for ; Fri, 1 Mar 2024 11:10:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709291404; cv=none; b=qalCEJzmiMF8vDu5nzttI4sid4QN7zIuuns11yhfllq2za03E6dXMGtaATSnRq0ySFCcrhUilE2JdRVkb0OCtPCKcDbjAGDQsDq7NPoiioGUInE1gK/XHK5ikU/8rZF8n0l33s98g0hOe2Z5G/VOwan2hLd0u83hCLKpX96QNl4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709291404; c=relaxed/simple; bh=TW5vxueQOJxD0Gl+Zr9DXeL15E/AlN64VY2kWOen7vo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=nFiC4Awe22bgsCNOKgUGI49ScXUMskQRyHahExUm3SkHvuu1tFa2hLhC6u77NfLr3IaLC5HbkBCIcNI6fkuf3o5vcAKnmcdeHUtH7tkOT6/ZG3rdKh4OH1yA9/xbpoG/ojBYsTYOUJQ/k9JboROXxsXHICeCPkgU90LrWzWoRro= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ZCZo2iIH; arc=none smtp.client-ip=209.85.167.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZCZo2iIH" Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-512bc0e8ce1so1959620e87.0 for ; Fri, 01 Mar 2024 03:10:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709291400; x=1709896200; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=cD+TwI/HZoywmTZsork3oY9Fn4598AcRR6hubkpx5Is=; b=ZCZo2iIHD2E3VruiEiIKkdJTD+v54T6356yDyC84CeEt7YNjLQWzMxndxxFmBoFLHQ q1YTs8qDc7xoSHLI7ZgPsiSjpqNsDWTcfO25t4W2dbfBVdRX+Biy8/XPFbaivz/eQJPP z0TEsr5xVHgQett/NQQN++iGir4IFI9GaRY6WFqb/HlcirXNEbe5NloDHPSImXDjjhJt cMSQPEWqACRelWeT4S+mxmRxK4qNBupHrge66Y9+zVqPIObRDxX/Ps4+2Hfije6nicap h8ZrPn/2eJYz03nvYfg7XvvZPRRh2RkT/qpiuEPSzAZ3N7nmg9iZ0Dt05gziWEzM7xcn z1Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709291400; x=1709896200; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=cD+TwI/HZoywmTZsork3oY9Fn4598AcRR6hubkpx5Is=; b=om3C/oQaQ8bY0cY1JCIwM9+DqsWqwugvcL4wk/IiNpjT4Tf04bFE6okKZ6tVlFy1Lx KHFF8sNIme3qkE29T8wqMbKcvAhiffTig05gXhHQP31j+6TjpxLW+B6dX/7OnGPRfXNB Cjt/DgZgLSbe9YCwlAPgLIH6ymOtqHU++mWUcKX1BYzqSNHpNwFxqyCaGdX+IkJQ4cQd +5MoKlfb8NwAqdl9gWpWWjmhJDGghpDwKIvTDrF0m8WmgFZ8sfAOokWxGoxWpn4FBc7q z1CLfyK69Um5qJwc49go3NmbO18CGRbjX6Kv/m71LHysz0kN7UtZROJY5Zmk4WIubnHb wZuw== X-Gm-Message-State: AOJu0Yyg7It3YgQExiBrVaSpN+Jjlz7x0GbasHyTi33pqcVFytkqV+AT WbnVCZ7z2j1cjyjwfov+UySdTVTa125/hfy5rweToQEFoYskdzAdr44haBe4z80= X-Google-Smtp-Source: AGHT+IFZmXK36GHtWeo4/3f9acagQmXhkFu8EzEAUZIIqmlfI1V3pCIXrW9iS/6WMshtPQAAvuexPQ== X-Received: by 2002:ac2:5634:0:b0:512:f628:32b9 with SMTP id b20-20020ac25634000000b00512f62832b9mr824309lff.27.1709291400460; Fri, 01 Mar 2024 03:10:00 -0800 (PST) Received: from kepler.redhat.com (1F2EF13F.nat.pool.telekom.hu. [31.46.241.63]) by smtp.gmail.com with ESMTPSA id b20-20020a05600c4e1400b00412cad66f8fsm490264wmq.44.2024.03.01.03.09.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 03:09:59 -0800 (PST) Sender: Ingo Molnar From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Linus Torvalds , Valentin Schneider Subject: [PATCH 4/7] sched/balancing: Fix comments (trying to) refer to NOHZ_BALANCE_KICK Date: Fri, 1 Mar 2024 12:09:48 +0100 Message-Id: <20240301110951.3707367-5-mingo@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240301110951.3707367-1-mingo@kernel.org> References: <20240301110951.3707367-1-mingo@kernel.org> 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 Content-Type: text/plain; charset="utf-8" Fix two typos: - There's no such thing as 'nohz_balancing_kick', the flag is named 'BALANCE' and is capitalized: NOHZ_BALANCE_KICK. - Likewise there's no such thing as a 'pending nohz_balance_kick' either, the NOHZ_BALANCE_KICK flag is all upper-case. Signed-off-by: Ingo Molnar Cc: Peter Zijlstra Cc: Vincent Guittot Cc: Dietmar Eggemann Cc: Linus Torvalds Cc: Valentin Schneider --- kernel/sched/fair.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 934ace69eb30..31838b9dcf36 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -12410,14 +12410,14 @@ static int newidle_balance(struct rq *this_rq, st= ruct rq_flags *rf) =20 /* * run_rebalance_domains is triggered when needed from the scheduler tick. - * Also triggered for nohz idle balancing (with nohz_balancing_kick set). + * Also triggered for NOHZ idle balancing (with NOHZ_BALANCING_KICK set). */ static __latent_entropy void run_rebalance_domains(struct softirq_action *= h) { struct rq *this_rq =3D this_rq(); enum cpu_idle_type idle =3D this_rq->idle_balance; /* - * If this CPU has a pending nohz_balance_kick, then do the + * If this CPU has a pending NOHZ_BALANCE_KICK, then do the * balancing on behalf of the other idle CPUs whose ticks are * stopped. Do nohz_idle_balance *before* rebalance_domains to * give the idle CPUs a chance to load balance. Else we may --=20 2.40.1 From nobody Sun Feb 8 18:27:22 2026 Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5D2DC6CDD6 for ; Fri, 1 Mar 2024 11:10:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709291405; cv=none; b=giVk3tWJ5PJ8dS+8VHsr3BtUkxkGemTcoc8tQt+Or2c19WWngcn6GnAX6Pu4jNZBzLaZkdi0875OzV54bKfiEaJjo0Wm6RPBTH79Y4FL5ibnq+x1ck9ofbI+Y6KUjCvjTdOcv0DxJXyEG9WpHiyouaIt+TRQa6gV1rBC4YdZpAQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709291405; c=relaxed/simple; bh=LV1fyBSu3ZwpN4ZiEusmgcvF6MxivbLEh1Lghj2THIw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=qDxE7sdY6WbYhxaz9NW/TZzS+1gUA7aVTjzJ8ZwzLM9eVecdNxP5xsUbcSpfTAX3/NAmUYNUJj8gF7py6oxy90hoxGZBV9peWz/JPq20xaF9p50DXZzoJ7tDUCP370q83uWvi1Jh24RYq6tNJtBA0pkVCujRPdfY/OBO7ATuCPI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=kRxinnnD; arc=none smtp.client-ip=209.85.167.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kRxinnnD" Received: by mail-lf1-f47.google.com with SMTP id 2adb3069b0e04-513230201b2so1822699e87.1 for ; Fri, 01 Mar 2024 03:10:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709291401; x=1709896201; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=AYY5vhGREGmnIQ7NfihjkFOwl5i8Nexdj/rtVbJhxCk=; b=kRxinnnDoTzXlGHqXXGnPJ85UTCRw5YUg1vXk2Skn7hi1SGtRCCY+supBv6ivh9pJZ iLQCPijkLoXdfn9C4mUJONOp7nRDmz+YNDn9IhnvdGDRmlOOBNLCJrnlQLoPsJjGaHe7 b+d8/nSgNyjpGq5nGurY1lQPokWx+fDslRVOt1A5zW36CwrZnK0c7hVn/emq6u6q7KAP 53CmyTb9SIQpYe/9LhMh1UDtlbudEhtXLIyQr/vR5NvK+ma6dxIheO3YnYUb4Ksb+ZLg QlTED4yi1hUEUPULSmOKWXCo5jgyoLg11TxdWTRLWG6SiTjiLO0oJ/+LP2XAXBXEJS4k dcIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709291401; x=1709896201; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=AYY5vhGREGmnIQ7NfihjkFOwl5i8Nexdj/rtVbJhxCk=; b=MB/PU4mq00KqB1oz+fxuz5SlbFcx/46/Dsak7V4C6o8C11NfME3gGInstu17qfzr0Y SFo9szWXSDY51yDQx0dmXg4r3uZPapsW9i+K29gNS/uTOaDoDuKS7Hr5mnu13tgbi+yn S3IuCz6nfO4HZfnCDf3pW83dvGhaVBTjkSOdu3PsDZlhknSv8M8vcj4CsLPNW40wwru+ pUiSgU24EZeibFEUEaQuJRnPSWsXVH0j/uT/3+EaXXC6YC+7Mq5Xy1pOK6RsH4Bs0eCD PTqp6JvPFJL/XijRaf4LjG6vU7QxbUe7k6glOOVlJx3QOlAkKDOLViII6OFSwUoFHrcf nGYw== X-Gm-Message-State: AOJu0YzRSzVPpEIJ+SV587HNV/7PqcdXcSfwTYEicUEQF2ho0E3i9XpP B5XtPWYz6XOk3OcpeanEGrWSN8dyC516OGdKQ/lL9l1UXro6dkmnNI1Q4f4FcFg= X-Google-Smtp-Source: AGHT+IHx2omjBwV13BMAVRo0qLA80YK8oxD3iBNrU+OgrtEJ+EsjKczxiZhF+ZpPK05I0fb+A4lrAQ== X-Received: by 2002:ac2:5b85:0:b0:512:bed5:3d87 with SMTP id o5-20020ac25b85000000b00512bed53d87mr982592lfn.23.1709291401482; Fri, 01 Mar 2024 03:10:01 -0800 (PST) Received: from kepler.redhat.com (1F2EF13F.nat.pool.telekom.hu. [31.46.241.63]) by smtp.gmail.com with ESMTPSA id b20-20020a05600c4e1400b00412cad66f8fsm490264wmq.44.2024.03.01.03.10.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 03:10:00 -0800 (PST) Sender: Ingo Molnar From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Linus Torvalds , Valentin Schneider Subject: [PATCH 5/7] sched/balancing: Update run_rebalance_domains() comments Date: Fri, 1 Mar 2024 12:09:49 +0100 Message-Id: <20240301110951.3707367-6-mingo@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240301110951.3707367-1-mingo@kernel.org> References: <20240301110951.3707367-1-mingo@kernel.org> 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 Content-Type: text/plain; charset="utf-8" The first sentence of the comment explaining run_rebalance_domains() is historic and not true anymore: * run_rebalance_domains is triggered when needed from the scheduler tic= k. ... contradicted/modified by the second sentence: * Also triggered for NOHZ idle balancing (with NOHZ_BALANCING_KICK set). Avoid that kind of confusion straight away and explain from what places sched_balance_softirq() is triggered. Signed-off-by: Ingo Molnar Cc: Peter Zijlstra Cc: Vincent Guittot Cc: Dietmar Eggemann Cc: Linus Torvalds Cc: Valentin Schneider --- kernel/sched/fair.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 31838b9dcf36..0e13b0016f33 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -12409,8 +12409,13 @@ static int newidle_balance(struct rq *this_rq, str= uct rq_flags *rf) } =20 /* - * run_rebalance_domains is triggered when needed from the scheduler tick. - * Also triggered for NOHZ idle balancing (with NOHZ_BALANCING_KICK set). + * The run_rebalance_domains() softirq handler is triggered via SCHED_SOFT= IRQ + * from two places: + * + * - the scheduler_tick(), + * + * - from the SMP cross-call function nohz_csd_func(), + * used by NOHZ idle balancing (with NOHZ_BALANCING_KICK set). */ static __latent_entropy void run_rebalance_domains(struct softirq_action *= h) { --=20 2.40.1 From nobody Sun Feb 8 18:27:22 2026 Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6BDE46D1BC for ; Fri, 1 Mar 2024 11:10:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709291406; cv=none; b=SGk6BgxaQhjxuwdtqCW3C4gcNdpaprzYGF+S/79DuMzoqDTHq4jlW0TO1Iy4sT2OHberQy2W16cIGaAYs1HRbM3YFHjlKFniqqgaSh5G/+kJMs9rXmjr85RYFhU0Mh9r+g0pA+P8VceDrr+k1kuAadrIaUGqAQ4qu53QUOFLcLg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709291406; c=relaxed/simple; bh=trfivC8vG6hLXCya2zGOrWr40HQ6g3p1iNxASZJFkrs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Reas5GSkfbmi26M3q9vZIxmLI1w9oO6Xfxo1UnNLAA/xSi+6fYE20HE9gXfiyneqOXnEpl74GrYsrX4V1gGjZ/MficJafIkGCUYkcHXJ8Eifufvk/RK6BOA4ql5+QZpjbkv/821DkohhliV5ZAdJV9prScMZdm8IygZ7+0eFmMY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=MH2QSPN8; arc=none smtp.client-ip=209.85.208.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MH2QSPN8" Received: by mail-lj1-f179.google.com with SMTP id 38308e7fff4ca-2d180d6bd32so20220081fa.1 for ; Fri, 01 Mar 2024 03:10:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709291402; x=1709896202; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=FsbzmPBgmd/PDvdJrOlCLNy3reKyEs/GH7VUyr30KAw=; b=MH2QSPN8McSPaZM8MAoLJ5plo31CPRlIOkIBmdIh3MV9T1SPLH5pIgPVvD2+mBPluH 4ljb5w+Pp2e2WrviJz0IDVmoPNxfVeqLK6XpL+W0TdMFTOUCIVEeGNuHpFz3wgJJ8aDl v3Uwd5DX/bVpunGcGfSZuXRQ4xo7W8BvmIolA0PU7uFY5EZXh60q/vmUybCYaQ7s/WaT Jf7Nm2cIDwO1idutXsi0WFnaacX1fsMfTGSzUgMJ9EhxYVxvh1YgzAfQVIF2bBIpr7WE JpHwLLhc/ME7XbFd0vm4MF37wd4iUL22+A4goM/AVrsZ3pkws6rnH/9MATEWrPdlNdQf dVPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709291402; x=1709896202; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=FsbzmPBgmd/PDvdJrOlCLNy3reKyEs/GH7VUyr30KAw=; b=HQdzrtbL2PvmMYZpfj5+PSLfmMwqTBKuaMCBiI7dFHYa208Hu7AhKY/5UUq1XfurFH bMYt3899RgK1HarD4uHgj1bN8uPmYXIU6xZh4AICzS5EM50e0RSj2W+0xlz62cL7qGAE AcXrPrW8OB0RiiJq/RNncgs3bKd7FNfghoW77+TLDBsZN+C5fJZe/8xeK6+iLqFJzelc 0w4WI5qBbCMw6YT1E3aPTsXiXkIbtHknM3MK+CiyBAvHlI2VopkB7pxH9UCirJZ0stfi FLUhDTbG1wBTcgkv+takwsxYXWds4nOVd3uocbe2FMHLJztPUV0ewU5bhCo0OPYtOA9y dQ4Q== X-Gm-Message-State: AOJu0Yz/oE8j1rgDfsIhU2Z17PCn0icsLM/sK41SKOZMBiyWdEnH+yBJ 680WnhrWCw/t7Ns8+/hhQmCa6G7U/9aDM51teQplgfbtasA6gygqiRT2WTt8p/c= X-Google-Smtp-Source: AGHT+IFm5psR3SfBycTnthdTG0tbEc2ft0NApkF4oN3RC78E9vOMGTa1BQgwiQGSSYr29Qe/VkoEfg== X-Received: by 2002:a2e:b54e:0:b0:2d2:779d:3054 with SMTP id a14-20020a2eb54e000000b002d2779d3054mr931113ljn.0.1709291402467; Fri, 01 Mar 2024 03:10:02 -0800 (PST) Received: from kepler.redhat.com (1F2EF13F.nat.pool.telekom.hu. [31.46.241.63]) by smtp.gmail.com with ESMTPSA id b20-20020a05600c4e1400b00412cad66f8fsm490264wmq.44.2024.03.01.03.10.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 03:10:02 -0800 (PST) Sender: Ingo Molnar From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Linus Torvalds , Valentin Schneider Subject: [PATCH 6/7] sched/balancing: Vertically align the comments of 'struct sg_lb_stats' and 'struct sd_lb_stats' Date: Fri, 1 Mar 2024 12:09:50 +0100 Message-Id: <20240301110951.3707367-7-mingo@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240301110951.3707367-1-mingo@kernel.org> References: <20240301110951.3707367-1-mingo@kernel.org> 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 Content-Type: text/plain; charset="utf-8" Make them easier to read. Signed-off-by: Ingo Molnar Cc: Peter Zijlstra Cc: Vincent Guittot Cc: Dietmar Eggemann Cc: Linus Torvalds Cc: Valentin Schneider --- kernel/sched/fair.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 0e13b0016f33..99495c93e094 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -9436,19 +9436,19 @@ static void update_blocked_averages(int cpu) * sg_lb_stats - stats of a sched_group required for load_balancing */ struct sg_lb_stats { - unsigned long avg_load; /*Avg load across the CPUs of the group */ - unsigned long group_load; /* Total load over the CPUs of the group */ + unsigned long avg_load; /* Avg load across the CPUs of the group */ + unsigned long group_load; /* Total load over the CPUs of the group */ unsigned long group_capacity; - unsigned long group_util; /* Total utilization over the CPUs of the group= */ - unsigned long group_runnable; /* Total runnable time over the CPUs of the= group */ - unsigned int sum_nr_running; /* Nr of tasks running in the group */ - unsigned int sum_h_nr_running; /* Nr of CFS tasks running in the group */ + unsigned long group_util; /* Total utilization over the CPUs of the grou= p */ + unsigned long group_runnable; /* Total runnable time over the CPUs of th= e group */ + unsigned int sum_nr_running; /* Nr of tasks running in the group */ + unsigned int sum_h_nr_running; /* Nr of CFS tasks running in the group */ unsigned int idle_cpus; unsigned int group_weight; enum group_type group_type; - unsigned int group_asym_packing; /* Tasks should be moved to preferred CP= U */ - unsigned int group_smt_balance; /* Task on busy SMT be moved */ - unsigned long group_misfit_task_load; /* A CPU has a task too big for its= capacity */ + unsigned int group_asym_packing; /* Tasks should be moved to preferred CP= U */ + unsigned int group_smt_balance; /* Task on busy SMT be moved */ + unsigned long group_misfit_task_load; /* A CPU has a task too big for its= capacity */ #ifdef CONFIG_NUMA_BALANCING unsigned int nr_numa_running; unsigned int nr_preferred_running; @@ -9460,15 +9460,15 @@ struct sg_lb_stats { * during load balancing. */ struct sd_lb_stats { - struct sched_group *busiest; /* Busiest group in this sd */ - struct sched_group *local; /* Local group in this sd */ - unsigned long total_load; /* Total load of all groups in sd */ - unsigned long total_capacity; /* Total capacity of all groups in sd */ - unsigned long avg_load; /* Average load across all groups in sd */ - unsigned int prefer_sibling; /* tasks should go to sibling first */ + struct sched_group *busiest; /* Busiest group in this sd */ + struct sched_group *local; /* Local group in this sd */ + unsigned long total_load; /* Total load of all groups in sd */ + unsigned long total_capacity; /* Total capacity of all groups in sd */ + unsigned long avg_load; /* Average load across all groups in sd */ + unsigned int prefer_sibling; /* tasks should go to sibling first */ =20 - struct sg_lb_stats busiest_stat;/* Statistics of the busiest group */ - struct sg_lb_stats local_stat; /* Statistics of the local group */ + struct sg_lb_stats busiest_stat; /* Statistics of the busiest group */ + struct sg_lb_stats local_stat; /* Statistics of the local group */ }; =20 static inline void init_sd_lb_stats(struct sd_lb_stats *sds) --=20 2.40.1 From nobody Sun Feb 8 18:27:22 2026 Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3B8FD6D526 for ; Fri, 1 Mar 2024 11:10:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709291407; cv=none; b=J5EuqM5Ub1Wsif0yq+k1ILC5cIvsGf6eDCrDEOm9Enzx9T9UH+WlPRsMPpe5IsCQ5pA91D8TPKDe2xiKhwI005wUe8uAiBNkVDbOAzNH5kl3xAxqURVyWdsUkb+ZfQu9xXEAyFHmZDYBYizojr8Wm7unDWi1NqRM3hz43URyGxQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709291407; c=relaxed/simple; bh=VDa2JdCTxD1j1f4It6rpxinY5I86VrDhb2Fk6B2iY9c=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=D/1yW2TK/bsmmt0qo+/OmPwMJ4MMVxlGOk5IzuCDnABXEx6jFWh2LEutB5bJaEbkQMqgcS1xg4/kGqUuijnelm6T+OP30l/+oRgS0KnqMA2/0gPYrgXPPckp++SutK9VlmFhRhtFxXO4r5wo0fmYh26qsubpfiDt2lHJJYaE1wk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=IOCObmiD; arc=none smtp.client-ip=209.85.208.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IOCObmiD" Received: by mail-lj1-f173.google.com with SMTP id 38308e7fff4ca-2d26227d508so21790631fa.2 for ; Fri, 01 Mar 2024 03:10:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709291403; x=1709896203; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=AYC87+AtGNvd7VAVI78DNZ/P2pttTkG+THLM0HRfjPU=; b=IOCObmiDfhvDuoi1Jc+G60zlPKDmuyZO/bJcuY1w9hdKepoHbxTuvsLjTM3v31n1t3 6zc5UMVJot1uEl51+a19zLT/KenmxlO2Rv83Y/NHT3+Zff4w10N3eQSat3jmP8zWa58Q 1/vo6z67YDg92fbKGvCQMWp2G1J2vuPnFSB1y/bmKEwr/xXr4sttdrcMTpadPeJkeVPW m9acDMJS+YGgUvAiNDjVM8wDh08euYNp+g0yzDMAfyvY41col29znCinjP4zA8ORNWpL mX4mNdrncXP66T2cURanOaIoJ+7j+1300aQZmeS7UOKUX/zY5ay5ckSp96jnRd7EodBk Ukvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709291403; x=1709896203; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=AYC87+AtGNvd7VAVI78DNZ/P2pttTkG+THLM0HRfjPU=; b=uSz73WCRkY5tAplsTHa/J9HxPvfZuWeKqeJFGFd+DP2oRLfl9Z7BqAIAo0CdPYKZFX iFtNVZhbchj616yDBPnBn43l8JMI9vIcgiVP1W5FVTwmxr7ml/bCddmABk/MC6AuEaoP G5pnMHk3z3nk/8USfKSyZaW1v0jgRr5Cd1B3wWwDu2W6qy729Lc3YnPbcnPPtq35lNvK NV7r0CD0VRAVbcAjTDjkWyafpANKZsJzDinYidT3KNHhEn0hCRUvTTdfXnA7cFnzfkYw t5gtBnFLSmGjHRYx0QZcltzjeTYmWHN8l8btEhRraIhNwWVigXWts5GEAYDPDHmcNxPN VzIQ== X-Gm-Message-State: AOJu0Yw4Gy/N348cKBeUHnMyAuD/tad+4kkrNMSrtAXZoDGV9GfYNdhK 7w3XadccFylxTb7A42rC/N/j28ZsYEiyP5AO6n/pBOgrN+QSLKlDpXxhWoz7ySU= X-Google-Smtp-Source: AGHT+IH7nifUptW1CrFkd5gTff5Mf2tDV3sUzIfmtyxGXQUuH5Stu23h9ATuk4h00ru+ghdyUh98gQ== X-Received: by 2002:a05:6512:1193:b0:513:2447:d110 with SMTP id g19-20020a056512119300b005132447d110mr1238559lfr.62.1709291403428; Fri, 01 Mar 2024 03:10:03 -0800 (PST) Received: from kepler.redhat.com (1F2EF13F.nat.pool.telekom.hu. [31.46.241.63]) by smtp.gmail.com with ESMTPSA id b20-20020a05600c4e1400b00412cad66f8fsm490264wmq.44.2024.03.01.03.10.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 03:10:02 -0800 (PST) Sender: Ingo Molnar From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Linus Torvalds , Valentin Schneider Subject: [PATCH 7/7] sched/balancing: Update comments in 'struct sg_lb_stats' and 'struct sd_lb_stats' Date: Fri, 1 Mar 2024 12:09:51 +0100 Message-Id: <20240301110951.3707367-8-mingo@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240301110951.3707367-1-mingo@kernel.org> References: <20240301110951.3707367-1-mingo@kernel.org> 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 Content-Type: text/plain; charset="utf-8" - Align for readability - Capitalize consistently Signed-off-by: Ingo Molnar Cc: Peter Zijlstra Cc: Vincent Guittot Cc: Dietmar Eggemann Cc: Linus Torvalds Cc: Valentin Schneider --- kernel/sched/fair.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 99495c93e094..4e58b9334d88 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -9433,17 +9433,17 @@ static void update_blocked_averages(int cpu) /********** Helpers for find_busiest_group ************************/ =20 /* - * sg_lb_stats - stats of a sched_group required for load_balancing + * sg_lb_stats - stats of a sched_group required for load-balancing: */ struct sg_lb_stats { - unsigned long avg_load; /* Avg load across the CPUs of the group */ - unsigned long group_load; /* Total load over the CPUs of the group */ - unsigned long group_capacity; - unsigned long group_util; /* Total utilization over the CPUs of the grou= p */ + unsigned long avg_load; /* Avg load over the CPUs of the gro= up */ + unsigned long group_load; /* Total load over the CPUs of the gr= oup */ + unsigned long group_capacity; /* Capacity over the CPUs of th= e group */ + unsigned long group_util; /* Total utilization over the CPUs of the gr= oup */ unsigned long group_runnable; /* Total runnable time over the CPUs of th= e group */ - unsigned int sum_nr_running; /* Nr of tasks running in the group */ + unsigned int sum_nr_running; /* Nr of all tasks running in the group */ unsigned int sum_h_nr_running; /* Nr of CFS tasks running in the group */ - unsigned int idle_cpus; + unsigned int idle_cpus; /* Nr of idle CPUs in the= group */ unsigned int group_weight; enum group_type group_type; unsigned int group_asym_packing; /* Tasks should be moved to preferred CP= U */ @@ -9456,8 +9456,7 @@ struct sg_lb_stats { }; =20 /* - * sd_lb_stats - Structure to store the statistics of a sched_domain - * during load balancing. + * sd_lb_stats - stats of a sched_domain required for load-balancing: */ struct sd_lb_stats { struct sched_group *busiest; /* Busiest group in this sd */ @@ -9465,7 +9464,7 @@ struct sd_lb_stats { unsigned long total_load; /* Total load of all groups in sd */ unsigned long total_capacity; /* Total capacity of all groups in sd */ unsigned long avg_load; /* Average load across all groups in sd */ - unsigned int prefer_sibling; /* tasks should go to sibling first */ + unsigned int prefer_sibling; /* Tasks should go to sibling first */ =20 struct sg_lb_stats busiest_stat; /* Statistics of the busiest group */ struct sg_lb_stats local_stat; /* Statistics of the local group */ --=20 2.40.1