The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Quentin Perret <qperret@google.com>
To: Valentin Schneider <valentin.schneider@arm.com>
Cc: linux-kernel@vger.kernel.org, mingo@redhat.com,
	peterz@infradead.org, vincent.guittot@linaro.org,
	dietmar.eggemann@arm.com, morten.rasmussen@arm.com,
	adharmap@codeaurora.org
Subject: Re: [PATCH 1/3] sched/fair: Add asymmetric CPU capacity wakeup scan
Date: Fri, 24 Jan 2020 12:59:05 +0000	[thread overview]
Message-ID: <20200124125905.GA173888@google.com> (raw)
In-Reply-To: <20200124124255.1095-2-valentin.schneider@arm.com>

Hey Valentin,

On Friday 24 Jan 2020 at 12:42:53 (+0000), Valentin Schneider wrote:
> +/*
> + * Scan the asym_capacity domain for idle CPUs; pick the first idle one on which
> + * the task fits.
> + */
> +static int select_idle_capacity(struct task_struct *p, int target)
> +{
> +	struct cpumask *cpus = this_cpu_cpumask_var_ptr(select_idle_mask);
> +	struct sched_domain *sd;
> +	int cpu;
> +
> +	if (!static_branch_unlikely(&sched_asym_cpucapacity))
> +		return -1;
> +
> +	sd = rcu_dereference(per_cpu(sd_asym_cpucapacity, target));
> +	if (!sd)
> +		return -1;
> +

You might want 'sync_entity_load_avg(&p->se)' here no ?
find_idlest_cpu() and wake_cap() need one, but since we're going to use
them, you'll want to sync here too I think.


> +	cpumask_and(cpus, sched_domain_span(sd), p->cpus_ptr);
> +
> +	for_each_cpu_wrap(cpu, cpus, target) {
> +		if (!available_idle_cpu(cpu))
> +			continue;
> +		if (!task_fits_capacity(p, capacity_of(cpu)))
> +			continue;
> +
> +		return cpu;
> +	}

If we found an idle CPU, but not one big enough, should we still go
ahead and choose it ? Misfit / idle balance will fix that later when a
big CPU does become available.

> +
> +	return -1;
> +}
> +

Thanks,
Quentin

  parent reply	other threads:[~2020-01-24 12:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-24 12:42 [PATCH 0/3] sched/fair: Capacity aware wakeup rework Valentin Schneider
2020-01-24 12:42 ` [PATCH 1/3] sched/fair: Add asymmetric CPU capacity wakeup scan Valentin Schneider
2020-01-24 12:47   ` Valentin Schneider
2020-01-24 12:59   ` Quentin Perret [this message]
2020-01-24 12:42 ` [PATCH 2/3] sched/topology: Remove SD_BALANCE_WAKE on asymmetric capacity systems Valentin Schneider
2020-01-24 12:42 ` [PATCH 3/3] sched/fair: Kill wake_cap() Valentin Schneider

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200124125905.GA173888@google.com \
    --to=qperret@google.com \
    --cc=adharmap@codeaurora.org \
    --cc=dietmar.eggemann@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=morten.rasmussen@arm.com \
    --cc=peterz@infradead.org \
    --cc=valentin.schneider@arm.com \
    --cc=vincent.guittot@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox