public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>
To: dmitry.adamushko@gmail.com
Cc: "Balbir Singh" <balbir@linux.vnet.ibm.com>,
	"Ingo Molnar" <mingo@elte.hu>,
	"Linux Kernel" <linux-kernel@vger.kernel.org>
Subject: Re: [patch] CFS scheduler, -v15
Date: Thu, 14 Jun 2007 18:13:24 +0530	[thread overview]
Message-ID: <20070614124324.GB30965@linux.vnet.ibm.com> (raw)
In-Reply-To: <20070606113733.GD3274@in.ibm.com>

On Wed, Jun 06, 2007 at 05:07:33PM +0530, Srivatsa Vaddagiri wrote:
> > I don't think that rt_sched_class :: dequeue_task_rt() is in any of
> > such "fast pathes" that we should really care about an additional
> > math. operation.
> > 
> > If this approach is ok, logically-wise (no side effects from a short
> > 'delta_exec', esp. on RT -> NORMAL).. I think it's better as it keeps
> > the 'sched_class' interface simpler.
> 
> I can see your point, given that we just update exec_start in
> dequeue_task_rt(). However the situation is slightly more complex in my
> patch stack, as I need to update other things during group change. Perhaps
> we can postpone this discussion until I post that patch stack.

Now that I have posted the group scheduling patch stack, we can come
back to this point.

Basically I am maintaining a ->curr field in 'struct lrq' (when
CONFIG_FAIR_GROUP_SCHED is on). It is NULL if the lrq is "inactive" [ none of 
its entities are currently running ], otherwise it points to the currentive 
active entity. This helps me optimize some functions like update_curr() - when 
lrq->curr is NULL, we don't have to update fair_clock etc upon enqueue/dequeue 
to the lrq.

pick_next_entity() sets lrq->curr while put_prev_entity resets lrq->curr
to NULL.

Also these lrqs could form a hierarchy. At the top could be a lrq which
holds user-level sched entities on each cpu. Next, each user's lrq could
hold task-level entities.

So when a task moves from RT class to NORMAL class, it will get added to
one of the lrqs (say root user's lrq on CPU0). At that time, I need to:

	root_user_lrq[cpu0]->curr = &task_moving->se;
	top_lrq[cpu0]->curr = &root_user->se;

I have added a special callback set_curr_task() in fair_sched_class to
accomplish this.

Similarly when a task moves from NORMAL class to RT class, I need to:

	root_user_cpu0_lrq->curr = NULL;
	top_lrq_cpu0->curr = NULL;

For this I am reusing the put_prev_task() callback.

I have to accomplish the same steps when a task moves from one group to
other also.

Let me know what you think about set_curr_task() callback [in Patch #6]. The 
other option was to tackle this requirement in enqueue/dequeue_task (if
current task is being enqueue/dequeued then set/reset lrq->curr), which I felt
add unnecessary overhead in normal path (a current task for ex gets
dequeued when it goes to sleep).

-- 
Regards,
vatsa

      parent reply	other threads:[~2007-06-14 12:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-31 15:09 [patch] CFS scheduler, -v15 Ingo Molnar
2007-06-06  6:42 ` Srivatsa Vaddagiri
2007-06-06  7:01   ` Ingo Molnar
2007-06-06  7:43     ` Srivatsa Vaddagiri
2007-06-06  9:08       ` Dmitry Adamushko
2007-06-06 10:37         ` Balbir Singh
2007-06-06 10:59           ` Srivatsa Vaddagiri
2007-06-06 11:19             ` Dmitry Adamushko
2007-06-06 11:37               ` Srivatsa Vaddagiri
2007-06-06 11:46                 ` Srivatsa Vaddagiri
2007-06-14 12:43                 ` Srivatsa Vaddagiri [this message]

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=20070614124324.GB30965@linux.vnet.ibm.com \
    --to=vatsa@linux.vnet.ibm.com \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=dmitry.adamushko@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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