lkml.org 
[lkml]   [2009]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [RFC v2 PATCH 2/8] sched: Maintain aggregated tasks count in cfs_rq at each hierarchy level
    From
    Date
    On Wed, 2009-09-30 at 18:21 +0530, Bharata B Rao wrote:

    > diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
    > index 652e8bd..eeeddb8 100644
    > --- a/kernel/sched_fair.c
    > +++ b/kernel/sched_fair.c
    > @@ -243,6 +243,27 @@ find_matching_se(struct sched_entity **se, struct sched_entity **pse)
    >
    > #endif /* CONFIG_FAIR_GROUP_SCHED */
    >
    > +static void add_cfs_rq_tasks_running(struct sched_entity *se,
    > + unsigned long count)
    > +{
    > + struct cfs_rq *cfs_rq;
    > +
    > + for_each_sched_entity(se) {
    > + cfs_rq = cfs_rq_of(se);
    > + cfs_rq->nr_tasks_running += count;
    > + }
    > +}
    > +
    > +static void sub_cfs_rq_tasks_running(struct sched_entity *se,
    > + unsigned long count)
    > +{
    > + struct cfs_rq *cfs_rq;
    > +
    > + for_each_sched_entity(se) {
    > + cfs_rq = cfs_rq_of(se);
    > + cfs_rq->nr_tasks_running -= count;
    > + }
    > +}
    >
    > /**************************************************************
    > * Scheduling class tree data structure manipulation methods:
    > @@ -969,6 +990,7 @@ static void enqueue_task_fair(struct rq *rq, struct task_struct *p, int wakeup)
    > wakeup = 1;
    > }
    >
    > + add_cfs_rq_tasks_running(&p->se, 1);
    > hrtick_update(rq);
    > }
    >
    > @@ -991,6 +1013,7 @@ static void dequeue_task_fair(struct rq *rq, struct task_struct *p, int sleep)
    > sleep = 1;
    > }
    >
    > + sub_cfs_rq_tasks_running(&p->se, 1);
    > hrtick_update(rq);
    > }

    This seems daft, why not add the incement to the for_each_sched_entity()
    loop already present in both functions?





    \
     
     \ /
      Last update: 2009-10-13 16:31    [W:0.024 / U:63.340 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site