lkml.org 
[lkml]   [2020]   [May]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [RFC PATCH] sched/fair: correct llc shared domain's number of busy CPUs
On Mon, 4 May 2020 at 03:57, Hillf Danton <hdanton@sina.com> wrote:
>
>
> The comment says, if there is an imbalance between LLC domains (IOW we
> could increase the overall cache use), we need some less-loaded LLC
> domain to pull some load.
>
> To show that imbalance, record busy CPUs as they come and go by doing
> a minor cleanup for sd::nohz_idle.

Your comment failed to explain why we can get rid of sd->nohz_idle

>
> Cc: Mel Gorman <mgorman@techsingularity.net>
> Cc: Vincent Guittot <vincent.guittot@linaro.org>
> Cc: Valentin Schneider <valentin.schneider@arm.com>
> Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
> Signed-off-by: Hillf Danton <hdanton@sina.com>
> ---
>
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -10138,13 +10138,8 @@ static void set_cpu_sd_state_busy(int cp
>
> rcu_read_lock();
> sd = rcu_dereference(per_cpu(sd_llc, cpu));
> -
> - if (!sd || !sd->nohz_idle)
> - goto unlock;
> - sd->nohz_idle = 0;

you remove the use of sd->nohz_idle but you don't remove it from
struct sched_domain

> -
> - atomic_inc(&sd->shared->nr_busy_cpus);
> -unlock:
> + if (sd)
> + atomic_inc(&sd->shared->nr_busy_cpus);
> rcu_read_unlock();
> }
>
> @@ -10168,13 +10163,8 @@ static void set_cpu_sd_state_idle(int cp
>
> rcu_read_lock();
> sd = rcu_dereference(per_cpu(sd_llc, cpu));
> -
> - if (!sd || sd->nohz_idle)
> - goto unlock;
> - sd->nohz_idle = 1;
> -
> - atomic_dec(&sd->shared->nr_busy_cpus);
> -unlock:
> + if (sd)
> + atomic_dec(&sd->shared->nr_busy_cpus);
> rcu_read_unlock();
> }
>
>

\
 
 \ /
  Last update: 2020-05-04 09:54    [W:0.066 / U:0.576 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site