LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* Re: set_task_rq bug?
  2008-04-02  7:52 set_task_rq bug? Srivatsa Vaddagiri
@ 2008-04-02  7:48 ` Peter Zijlstra
  2008-04-02  8:12   ` Srivatsa Vaddagiri
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Zijlstra @ 2008-04-02  7:48 UTC (permalink / raw)
  To: vatsa; +Cc: Ingo Molnar, aneesh.kumar, dhaval, linux-kernel, Balbir Singh

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.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* set_task_rq bug?
@ 2008-04-02  7:52 Srivatsa Vaddagiri
  2008-04-02  7:48 ` Peter Zijlstra
  0 siblings, 1 reply; 3+ messages in thread
From: Srivatsa Vaddagiri @ 2008-04-02  7:52 UTC (permalink / raw)
  To: a.p.zijlstra
  Cc: Ingo Molnar, aneesh.kumar, dhaval, linux-kernel, Balbir Singh

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?

-- 
Regards,
vatsa

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: set_task_rq bug?
  2008-04-02  7:48 ` Peter Zijlstra
@ 2008-04-02  8:12   ` Srivatsa Vaddagiri
  0 siblings, 0 replies; 3+ messages in thread
From: Srivatsa Vaddagiri @ 2008-04-02  8:12 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Ingo Molnar, aneesh.kumar, dhaval, linux-kernel, Balbir Singh

On Wed, Apr 02, 2008 at 09:48:57AM +0200, Peter Zijlstra wrote:
> with !CONFIG_FAIR_GROUP_SCHED se.cfs_rq isn't even there.

You are right ..sorry abt the noise!

-- 
Regards,
vatsa

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-04-02  8:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-02  7:52 set_task_rq bug? Srivatsa Vaddagiri
2008-04-02  7:48 ` Peter Zijlstra
2008-04-02  8:12   ` Srivatsa Vaddagiri

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).