linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josh Don <joshdon@google.com>
To: jun qian <qianjun.kernel@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Daniel Bristot de Oliveira <bristot@redhat.com>,
	Paul Turner <pjt@google.com>, Oleg Rombakh <olegrom@google.com>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Steve Sistare <steven.sistare@oracle.com>,
	Tejun Heo <tj@kernel.org>, Rik van Riel <riel@surriel.com>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 1/2] sched: cgroup SCHED_IDLE support
Date: Tue, 3 Aug 2021 13:37:50 -0700	[thread overview]
Message-ID: <CABk29Nvf4RemeBxvvzHey2QQJdW9XTUh5hNq=ZU-OCQYrVBWzA@mail.gmail.com> (raw)
In-Reply-To: <CAKc596LT=zntozT6D2kPyfSiqdt1KfbrAX8PSvHxCPKRNuq1pA@mail.gmail.com>

Hi Jun,

> > @@ -7123,8 +7178,21 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_
> >                 return;
> >
> >         find_matching_se(&se, &pse);
> > -       update_curr(cfs_rq_of(se));
> >         BUG_ON(!pse);
> > +
> > +       cse_is_idle = se_is_idle(se);
> > +       pse_is_idle = se_is_idle(pse);
> > +
> > +       /*
> > +        * Preempt an idle group in favor of a non-idle group (and don't preempt
> > +        * in the inverse case).
> > +        */
> > +       if (cse_is_idle && !pse_is_idle)
> > +               goto preempt;
>
> In the next schedule, it will pick next entity, How do we ensure that
> the entity selected next time will not be an idle
> entity. So I think we need to do something to idle group when picking
> next entity, For example, when we pick next
> entity, we try to choose normal group as much as possible.

Yep, exactly, this is achieved by adjusting the weight of idle
entities to the minimum value (see sched_group_set_idle()).

> Do we need to do something in the sched tick for the situation with
> idle entities?

check_preempt_tick() should already be sufficient, given that vruntime
for idle entities  will advance quickly, and in patch 2/2 I adjusted
the sched_slice for idle entities to allow for smaller than
min_granularity. Did you have a more specific concern?

Best,
Josh

  reply	other threads:[~2021-08-03 20:38 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-30  2:00 [PATCH v2 0/2] SCHED_IDLE extensions Josh Don
2021-07-30  2:00 ` [PATCH v2 1/2] sched: cgroup SCHED_IDLE support Josh Don
2021-08-03  2:14   ` jun qian
2021-08-03 20:37     ` Josh Don [this message]
2021-08-05 10:18   ` Peter Zijlstra
2021-08-05 17:13     ` Tejun Heo
2021-08-05 23:54       ` Josh Don
2021-08-11 13:48   ` Vincent Guittot
2021-08-23  9:26   ` [tip: sched/core] sched: Cgroup " tip-bot2 for Josh Don
2021-07-30  2:00 ` [PATCH 2/2] sched: adjust SCHED_IDLE interactions Josh Don
2021-08-11 13:31   ` Vincent Guittot
2021-08-12 21:09     ` Josh Don
2021-08-13 12:43       ` Vincent Guittot
2021-08-13 23:55         ` Josh Don
2021-08-16 12:31       ` Peter Zijlstra
2021-08-17 23:48         ` Josh Don
2021-08-16 12:52     ` Peter Zijlstra
2021-08-16 12:56       ` Vincent Guittot
2021-08-17 23:40       ` Josh Don
2021-08-16 12:31   ` Peter Zijlstra

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='CABk29Nvf4RemeBxvvzHey2QQJdW9XTUh5hNq=ZU-OCQYrVBWzA@mail.gmail.com' \
    --to=joshdon@google.com \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=olegrom@google.com \
    --cc=peterz@infradead.org \
    --cc=pjt@google.com \
    --cc=qianjun.kernel@gmail.com \
    --cc=riel@surriel.com \
    --cc=rostedt@goodmis.org \
    --cc=steven.sistare@oracle.com \
    --cc=tj@kernel.org \
    --cc=vincent.guittot@linaro.org \
    --cc=viresh.kumar@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;
as well as URLs for NNTP newsgroup(s).