lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1255444021.8392.364.camel@twins>
Date:	Tue, 13 Oct 2009 16:27:01 +0200
From:	Peter Zijlstra <a.p.zijlstra@...llo.nl>
To:	bharata@...ux.vnet.ibm.com
Cc:	linux-kernel@...r.kernel.org,
	Dhaval Giani <dhaval@...ux.vnet.ibm.com>,
	Balbir Singh <balbir@...ux.vnet.ibm.com>,
	Vaidyanathan Srinivasan <svaidy@...ux.vnet.ibm.com>,
	Gautham R Shenoy <ego@...ibm.com>,
	Srivatsa Vaddagiri <vatsa@...ibm.com>,
	Ingo Molnar <mingo@...e.hu>,
	Pavel Emelyanov <xemul@...nvz.org>,
	Herbert Poetzl <herbert@...hfloor.at>,
	Avi Kivity <avi@...hat.com>,
	Chris Friesen <cfriesen@...tel.com>,
	Paul Menage <menage@...gle.com>,
	Mike Waychison <mikew@...gle.com>
Subject: Re: [RFC v2 PATCH 2/8] sched: Maintain aggregated tasks count in
 cfs_rq at each hierarchy level

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?



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ