mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lin Ming <ming.m.lin@intel.com>
To: Yong Zhang <yong.zhang0@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
	"mingo@elte.hu" <mingo@elte.hu>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] sched: Remove WAKEUP_PREEMPT feature check in entity_tick
Date: Fri, 29 Jul 2011 15:36:15 +0800	[thread overview]
Message-ID: <1311924975.3938.1583.camel@minggr.sh.intel.com> (raw)
In-Reply-To: <20110729070356.GA10420@zhy>

On Fri, 2011-07-29 at 15:03 +0800, Yong Zhang wrote:
> On Fri, Jul 29, 2011 at 02:49:40PM +0800, Lin Ming wrote:
> > On Fri, 2011-07-29 at 14:21 +0800, Yong Zhang wrote:
> > > On Thu, Jul 28, 2011 at 05:43:23PM +0800, Lin Ming wrote:
> > > > Currently, entity_tick calls check_preempt_tick if WAKEUP_PREEMPT feature is
> > > > disabled. That's wrong. It should do that if the feature is enabled.
> > > 
> > > Why is it wrong?
> > > check_preempt_wakeup() is used for wakeup.
> > 
> > I guess you mean "check_preempt_tick" here, yes?
> 
> check_preempt_wakeup() excactly.
> try_to_wake_up()
>   check_preempt_curr()
>     sched_fair->check_preempt_wakeup()  <========== [1]
> 
> > 
> > in entity_tick(...):
> >         if (cfs_rq->nr_running > 1 || !sched_feat(WAKEUP_PREEMPT))
> >                 check_preempt_tick(cfs_rq, curr);
> > 
> > Note that, above "if" statement says "if WAKEUP_PREEMPT feature is
> > *disabled* then calls check_preempt_tick".
> 
> Yeah, if !sched_feat(WAKEUP_PREEMPT) [1] will just return;
> thus new waked task will wait until the next tick to schedule.
> 
> > 
> > Shouldn't it be "if WAKEUP_PREEMPT feature is *enabled* then ...."?
> 
> So no IMHO.
> 
> > 
> > > 
> > > > 
> > > > And actually the check is duplicate because check_preempt_tick will do
> > > > that. So just remove it from entity_tick.
> > > 
> > > It's not exactly duplicated. entity_tick() will resched_task(*p)
> > > if p's slice is over. So if there is an following wakeup(say X),
> > > then there is an opportunity for X to schedule quickly.
> > 
> > Understood this.
> > 
> > But what I mean is both "entity_tick" and "check_preempt_tick" check
> > WAKEUP_PREEMPT feature. That's duplicated.
> > 
> > Only need to check it in "check_preempt_tick".
> 
> I think we need that check(!sched_feat(WAKEUP_PREEMPT)) in entity_tick()
> to give new waked task better opportunity.

Thanks for your explanation.

>From another point of view, below !sched_feat(WAKEUP_PREEMPT) still
looks like duplicated.

        if (cfs_rq->nr_running > 1 || !sched_feat(WAKEUP_PREEMPT))
                check_preempt_tick(cfs_rq, curr);

if "!sched_feat(WAKEUP_PREEMPT)" is run,
that implies cfs_rq->nr_running == 1.

Why do we need to call check_preempt_tick when there is only 1 task
runnable?

Thanks,
Lin Ming



  reply	other threads:[~2011-07-29  7:36 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-28  9:43 Lin Ming
2011-07-29  6:21 ` Yong Zhang
2011-07-29  6:24   ` Yong Zhang
2011-07-29  6:49   ` Lin Ming
2011-07-29  7:03     ` Yong Zhang
2011-07-29  7:36       ` Lin Ming [this message]
2011-07-29  7:46         ` Yong Zhang
2011-07-29  7:56           ` Lin Ming
2011-07-29  7:56           ` Peter Zijlstra
2011-07-29  8:18             ` Yong Zhang
2011-07-29  8:20               ` Peter Zijlstra
2011-07-29  8:44                 ` Lin Ming
2011-07-29  8:46                 ` Yong Zhang
2011-07-29 11:45                   ` Peter Zijlstra
2011-08-01  1:33                     ` Yong Zhang
2011-07-29  8:20             ` [RFC PATCH] sched: Kill WAKEUP_PREEMPT Yong Zhang
2011-07-29  8:30               ` Lin Ming
2011-07-29  8:32                 ` Lin Ming
2011-08-14 15:57               ` [tip:sched/core] " tip-bot for Yong Zhang
2011-07-29  9:04             ` [PATCH] sched: Remove WAKEUP_PREEMPT feature check in entity_tick Mike Galbraith

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=1311924975.3938.1583.camel@minggr.sh.intel.com \
    --to=ming.m.lin@intel.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=yong.zhang0@gmail.com \
    /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

Powered by JetHome