From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: vatsa@linux.vnet.ibm.com
Cc: Ingo Molnar <mingo@elte.hu>,
aneesh.kumar@linux.vnet.ibm.com, dhaval@linux.vnet.ibm.com,
linux-kernel@vger.kernel.org, Balbir Singh <balbir@in.ibm.com>
Subject: Re: set_task_rq bug?
Date: Wed, 02 Apr 2008 09:48:57 +0200 [thread overview]
Message-ID: <1207122537.8514.752.camel@twins> (raw)
In-Reply-To: <20080402075255.GE17617@linux.vnet.ibm.com>
On Wed, 2008-04-02 at 13:22 +0530, Srivatsa Vaddagiri wrote:
> For the case of CONFIG_RT_GROUP_SCHED and !CONFIG_FAIR_GROUP_SCHED, this
> piece of code seems to be wrong?
>
> /* Change a task's cfs_rq and parent entity if it moves across
> * CPUs/groups */
> static inline void set_task_rq(struct task_struct *p, unsigned int cpu)
> {
> #ifdef CONFIG_FAIR_GROUP_SCHED
> p->se.cfs_rq = task_group(p)->cfs_rq[cpu];
> p->se.parent = task_group(p)->se[cpu];
> #endif
>
> #ifdef CONFIG_RT_GROUP_SCHED
> p->rt.rt_rq = task_group(p)->rt_rq[cpu];
> p->rt.parent = task_group(p)->rt_se[cpu];
> #endif
> }
>
> Basically for the above config case, a task's p->se.cfs_rq is never set,
> which seems to be incorrect, as lot of sched_fair.c (for ex:
> enqueue_task_fair) banks on the availability of this information. It should
> atleast be set to &rq->cfs?
struct sched_entity {
struct load_weight load; /* for load-balancing */
struct rb_node timeline_node;
#ifdef CONFIG_FAIR_GROUP_SCHED
struct rb_node deadline_node;
u64 vdeadline;
#endif
struct list_head group_node;
unsigned int on_rq;
u64 exec_start;
u64 sum_exec_runtime;
u64 vruntime;
u64 prev_sum_exec_runtime;
u64 last_wakeup;
u64 avg_overlap;
#ifdef CONFIG_SCHEDSTATS
...
#endif
#ifdef CONFIG_FAIR_GROUP_SCHED
struct sched_entity *parent;
/* rq on which this entity is (to be) queued: */
struct cfs_rq *cfs_rq;
/* rq "owned" by this entity/group: */
struct cfs_rq *my_q;
#endif
};
with !CONFIG_FAIR_GROUP_SCHED se.cfs_rq isn't even there.
next prev parent reply other threads:[~2008-04-02 7:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-02 7:52 set_task_rq bug? Srivatsa Vaddagiri
2008-04-02 7:48 ` Peter Zijlstra [this message]
2008-04-02 8:12 ` Srivatsa Vaddagiri
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=1207122537.8514.752.camel@twins \
--to=a.p.zijlstra@chello.nl \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=balbir@in.ibm.com \
--cc=dhaval@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=vatsa@linux.vnet.ibm.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