Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1720068

Re: [PATCH v2 4/5] sched/fair: Fix use of find_idlest_group when no groups are allowed

Path csiph.com!news.mixmin.net!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod
From Vincent Guittot <vincent.guittot@linaro.org>
Newsgroups linux.kernel
Subject Re: [PATCH v2 4/5] sched/fair: Fix use of find_idlest_group when no groups are allowed
Date Fri, 25 Aug 2017 15:40:03 +0200
Message-ID <uin07-4CU-39@gated-at.bofh.it> (permalink)
References <uijSx-2Ls-1@gated-at.bofh.it> <uijSx-2Ls-9@gated-at.bofh.it>
X-Original-To Brendan Jackman <brendan.jackman@arm.com>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Ttxf6aF+SlwHtXH29kobMGi7vR1FjnXYTQ+7+D/4UyQ=; b=GbXSz0+biQhO5SHE55/JDdjnhvpZKs6sJ+jrWttv16N8NqRHdPy6NAF+D1UeCSDzGZ u6OVF/jaNdwtggc9knsceIiJEvGDQymp39ptImJK0TV2+M8ABx2wRZiZMxeZv0Rffqgh asyDVLKatncLUEKFk169XVwxY8z6D+1bB9sv0=
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Ttxf6aF+SlwHtXH29kobMGi7vR1FjnXYTQ+7+D/4UyQ=; b=svpaJ2Z2FrPsMP5O5NAwUblfkwO0wg+BJtgCrfPHmV1bSxr5VlVRDDy7o7YJQi1VcP efBh7jRTzsvZ8hfjEdh6br8gneP6N45+0pITE4NzPa/Qxtp0WhevEppYmiWYLhEgaD5T PrL531eoXdjaBHbFAdtzTO20ce/14RxCy2OYoclqyX161ZzJhUY3TWGKMx1bGVgGoa19 /+HaLSFErkMhn1qo3Tm9+37l4XI7wD7ho+lcFijbwdIXM5ZrEuw308fxvKKiSid/BWJ4 06pFidX1i+onzwMmKxZNm7JZ8ENrZEznM4gBMF0Pl76X8tORphPGS2XdjW8QD2Hj3iuU ABkA==
X-Gm-Message-State AHYfb5ijVniA+HkoMjIHPewf9PluKXeX3jxOKPWYLMbqJdjE8UFXlTyf /q8ULD8o2VT3C3k4sMVvxOm6vMPId1jf
X-Received by 10.36.4.193 with SMTP id 184mr2378514itb.130.1503668386307; Fri, 25 Aug 2017 06:39:46 -0700 (PDT)
MIME-Version 1.0
Content-Type text/plain; charset="UTF-8"
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 52
Organization linux.* mail to news gateway
X-Original-Cc Ingo Molnar <mingo@redhat.com>, Peter Zijlstra <peterz@infradead.org>, linux-kernel <linux-kernel@vger.kernel.org>, Joel Fernandes <joelaf@google.com>, Andres Oportus <andresoportus@google.com>, Dietmar Eggemann <dietmar.eggemann@arm.com>, Josef Bacik <josef@toxicpanda.com>, Morten Rasmussen <morten.rasmussen@arm.com>
X-Original-Date Fri, 25 Aug 2017 15:39:25 +0200
X-Original-Message-ID <CAKfTPtBxLEQwJVV6_L27Vtrhi17goaYqTbyfrouXH9rTDLB=Hg@mail.gmail.com>
X-Original-References <20170825101632.28065-1-brendan.jackman@arm.com> <20170825101632.28065-5-brendan.jackman@arm.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1720068

Show key headers only | View raw


On 25 August 2017 at 12:16, Brendan Jackman <brendan.jackman@arm.com> wrote:
> When p is allowed on none of the CPUs in the sched_domain, we
> currently return NULL from find_idlest_group, and pointlessly
> continue the search on lower sched_domain levels (where p is also not
> allowed) before returning prev_cpu regardless (as we have not updated
> new_cpu).
>
> Add an explicit check for this case, and a comment to
> find_idlest_group. Now when find_idlest_group returns NULL, it always
> means that the local group is allowed and idlest.
>
> Signed-off-by: Brendan Jackman <brendan.jackman@arm.com>
> Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
> Cc: Vincent Guittot <vincent.guittot@linaro.org>
> Cc: Josef Bacik <josef@toxicpanda.com>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Morten Rasmussen <morten.rasmussen@arm.com>
> Cc: Peter Zijlstra <peterz@infradead.org>


Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>

> ---
>  kernel/sched/fair.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 0ce75bbcde45..26080917ff8d 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -5380,6 +5380,8 @@ static unsigned long capacity_spare_wake(int cpu, struct task_struct *p)
>  /*
>   * find_idlest_group finds and returns the least busy CPU group within the
>   * domain.
> + *
> + * Assumes p is allowed on at least one CPU in sd.
>   */
>  static struct sched_group *
>  find_idlest_group(struct sched_domain *sd, struct task_struct *p,
> @@ -5567,6 +5569,9 @@ static inline int find_idlest_cpu(struct sched_domain *sd, struct task_struct *p
>  {
>         int new_cpu = prev_cpu;
>
> +       if (!cpumask_intersects(sched_domain_span(sd), &p->cpus_allowed))
> +               return prev_cpu;
> +
>         while (sd) {
>                 struct sched_group *group;
>                 struct sched_domain *tmp;
> --
> 2.14.1
>

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/5] sched/fair: Tweaks for select_task_rq_fair slowpath Brendan Jackman <brendan.jackman@arm.com> - 2017-08-25 12:20 +0200
  [PATCH v2 1/5] sched/fair: Move select_task_rq_fair slow-path into its own function Brendan Jackman <brendan.jackman@arm.com> - 2017-08-25 12:20 +0200
    Re: [PATCH v2 1/5] sched/fair: Move select_task_rq_fair slow-path  into its own function Josef Bacik <josef@toxicpanda.com> - 2017-08-25 14:30 +0200
    Re: [PATCH v2 1/5] sched/fair: Move select_task_rq_fair slow-path  into its own function Vincent Guittot <vincent.guittot@linaro.org> - 2017-08-25 15:50 +0200
  [PATCH v2 5/5] sched/fair: Fix use of find_idlest_group when local group is idlest. Brendan Jackman <brendan.jackman@arm.com> - 2017-08-25 12:20 +0200
    Re: [PATCH v2 5/5] sched/fair: Fix use of find_idlest_group when  local group is idlest. Vincent Guittot <vincent.guittot@linaro.org> - 2017-08-25 15:40 +0200
      Re: [PATCH v2 5/5] sched/fair: Fix use of find_idlest_group when local group is idlest. Brendan Jackman <brendan.jackman@arm.com> - 2017-08-25 18:00 +0200
        Re: [PATCH v2 5/5] sched/fair: Fix use of find_idlest_group when  local group is idlest. Vincent Guittot <vincent.guittot@linaro.org> - 2017-08-28 11:00 +0200
          Re: [PATCH v2 5/5] sched/fair: Fix use of find_idlest_group when  local group is idlest. Vincent Guittot <vincent.guittot@linaro.org> - 2017-08-28 11:20 +0200
          Re: [PATCH v2 5/5] sched/fair: Fix use of find_idlest_group when local group is idlest. Brendan Jackman <brendan.jackman@arm.com> - 2017-08-29 19:20 +0200
  [PATCH v2 4/5] sched/fair: Fix use of find_idlest_group when no groups are allowed Brendan Jackman <brendan.jackman@arm.com> - 2017-08-25 12:20 +0200
    Re: [PATCH v2 4/5] sched/fair: Fix use of find_idlest_group when no  groups are allowed Vincent Guittot <vincent.guittot@linaro.org> - 2017-08-25 15:40 +0200
  [PATCH v2 3/5] sched/fair: Fix find_idlest_group when local group is not allowed Brendan Jackman <brendan.jackman@arm.com> - 2017-08-25 12:20 +0200
    Re: [PATCH v2 3/5] sched/fair: Fix find_idlest_group when local group  is not allowed Vincent Guittot <vincent.guittot@linaro.org> - 2017-08-25 15:50 +0200
  [PATCH v2 2/5] sched/fair: Remove unnecessary comparison with -1 Brendan Jackman <brendan.jackman@arm.com> - 2017-08-25 12:20 +0200
    Re: [PATCH v2 2/5] sched/fair: Remove unnecessary comparison with -1 Josef Bacik <josef@toxicpanda.com> - 2017-08-25 14:50 +0200
    Re: [PATCH v2 2/5] sched/fair: Remove unnecessary comparison with -1 Vincent Guittot <vincent.guittot@linaro.org> - 2017-08-25 15:50 +0200

csiph-web