All of lore.kernel.org
 help / color / mirror / Atom feed
From: dimm <dmitry.adamushko@gmail.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Roman Zippel <zippel@linux-m68k.org>,
	Mike Galbraith <efault@gmx.de>,
	dmitry.adamushko@gmail.com, linux-kernel@vger.kernel.org
Subject: Re: [announce] CFS-devel, performance improvements
Date: Fri, 14 Sep 2007 00:51:10 +0200	[thread overview]
Message-ID: <1189723870.4485.18.camel@earth> (raw)


Hi,

please find a couple of minor cleanups below (on top of sched-cfs-v2.6.23-rc6-v21-combo-3.patch):


(1)

Better placement of #ifdef CONFIG_SCHEDSTAT block in dequeue_entity().

Signed-off-by: Dmitry Adamushko <dmitry.adamushko@gmail.com>

---
diff -upr linux-2.6.23-rc6/kernel/sched_fair.c linux-2.6.23-rc6-my/kernel/sched_fair.c
--- linux-2.6.23-rc6/kernel/sched_fair.c	2007-09-13 21:38:49.000000000 +0200
+++ linux-2.6.23-rc6-my/kernel/sched_fair.c	2007-09-13 21:48:50.000000000 +0200
@@ -453,8 +453,8 @@ static void
 dequeue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int sleep)
 {
 	update_stats_dequeue(cfs_rq, se);
-	if (sleep) {
 #ifdef CONFIG_SCHEDSTATS
+	if (sleep) {
 		if (entity_is_task(se)) {
 			struct task_struct *tsk = task_of(se);
 
@@ -463,8 +463,8 @@ dequeue_entity(struct cfs_rq *cfs_rq, st
 			if (tsk->state & TASK_UNINTERRUPTIBLE)
 				se->block_start = rq_of(cfs_rq)->clock;
 		}
-#endif
 	}
+#endif
 	__dequeue_entity(cfs_rq, se);
 }
 
---


(2)

unless we are very eager to keep an additional layer of abstraction,
'struct load_stat' is redundant now so let's get rid of it.

Signed-off-by: Dmitry Adamushko <dmitry.adamushko@gmail.com>


---
diff -upr linux-2.6.23-rc6/kernel/sched.c linux-2.6.23-rc6-sched-dev/kernel/sched.c
--- linux-2.6.23-rc6/kernel/sched.c	2007-09-12 21:37:41.000000000 +0200
+++ linux-2.6.23-rc6-sched-dev/kernel/sched.c	2007-09-12 21:26:10.000000000 +0200
@@ -170,10 +170,6 @@ struct rt_prio_array {
 	struct list_head queue[MAX_RT_PRIO];
 };
 
-struct load_stat {
-	struct load_weight load;
-};
-
 /* CFS-related fields in a runqueue */
 struct cfs_rq {
 	struct load_weight load;
@@ -232,7 +228,7 @@ struct rq {
 #ifdef CONFIG_NO_HZ
 	unsigned char in_nohz_recently;
 #endif
-	struct load_stat ls;	/* capture load from *all* tasks on this cpu */
+	struct load_weight load;	/* capture load from *all* tasks on this cpu */
 	unsigned long nr_load_updates;
 	u64 nr_switches;
 
@@ -804,7 +800,7 @@ static int balance_tasks(struct rq *this
  * Update delta_exec, delta_fair fields for rq.
  *
  * delta_fair clock advances at a rate inversely proportional to
- * total load (rq->ls.load.weight) on the runqueue, while
+ * total load (rq->load.weight) on the runqueue, while
  * delta_exec advances at the same rate as wall-clock (provided
  * cpu is not idle).
  *
@@ -812,17 +808,17 @@ static int balance_tasks(struct rq *this
  * runqueue over any given interval. This (smoothened) load is used
  * during load balance.
  *
- * This function is called /before/ updating rq->ls.load
+ * This function is called /before/ updating rq->load
  * and when switching tasks.
  */
 static inline void inc_load(struct rq *rq, const struct task_struct *p)
 {
-	update_load_add(&rq->ls.load, p->se.load.weight);
+	update_load_add(&rq->load, p->se.load.weight);
 }
 
 static inline void dec_load(struct rq *rq, const struct task_struct *p)
 {
-	update_load_sub(&rq->ls.load, p->se.load.weight);
+	update_load_sub(&rq->load, p->se.load.weight);
 }
 
 static void inc_nr_running(struct task_struct *p, struct rq *rq)
@@ -967,7 +963,7 @@ inline int task_curr(const struct task_s
 /* Used instead of source_load when we know the type == 0 */
 unsigned long weighted_cpuload(const int cpu)
 {
-	return cpu_rq(cpu)->ls.load.weight;
+	return cpu_rq(cpu)->load.weight;
 }
 
 static inline void __set_task_cpu(struct task_struct *p, unsigned int cpu)
@@ -1933,7 +1929,7 @@ unsigned long nr_active(void)
  */
 static void update_cpu_load(struct rq *this_rq)
 {
-	unsigned long this_load = this_rq->ls.load.weight;
+	unsigned long this_load = this_rq->load.weight;
 	int i, scale;
 
 	this_rq->nr_load_updates++;
diff -upr linux-2.6.23-rc6/kernel/sched_debug.c linux-2.6.23-rc6-sched-dev/kernel/sched_debug.c
--- linux-2.6.23-rc6/kernel/sched_debug.c	2007-09-12 21:37:41.000000000 +0200
+++ linux-2.6.23-rc6-sched-dev/kernel/sched_debug.c	2007-09-12 21:36:04.000000000 +0200
@@ -137,7 +137,7 @@ static void print_cpu(struct seq_file *m
 
 	P(nr_running);
 	SEQ_printf(m, "  .%-30s: %lu\n", "load",
-		   rq->ls.load.weight);
+		   rq->load.weight);
 	P(nr_switches);
 	P(nr_load_updates);
 	P(nr_uninterruptible);
diff -upr linux-2.6.23-rc6/kernel/sched_fair.c linux-2.6.23-rc6-sched-dev/kernel/sched_fair.c
--- linux-2.6.23-rc6/kernel/sched_fair.c	2007-09-12 21:37:41.000000000 +0200
+++ linux-2.6.23-rc6-sched-dev/kernel/sched_fair.c	2007-09-12 21:35:27.000000000 +0200
@@ -499,7 +499,7 @@ set_next_entity(struct cfs_rq *cfs_rq, s
 	 * least twice that of our own weight (i.e. dont track it
 	 * when there are only lesser-weight tasks around):
 	 */
-	if (rq_of(cfs_rq)->ls.load.weight >= 2*se->load.weight) {
+	if (rq_of(cfs_rq)->load.weight >= 2*se->load.weight) {
 		se->slice_max = max(se->slice_max,
 			se->sum_exec_runtime - se->prev_sum_exec_runtime);
 	}

---


             reply	other threads:[~2007-09-13 22:51 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-13 22:51 dimm [this message]
2007-09-14  8:13 ` [announce] CFS-devel, performance improvements Ingo Molnar
2007-09-14  8:13 ` Ingo Molnar
  -- strict thread matches above, loose matches on Subject: below --
2007-09-13 23:25 dimm
2007-09-14  8:17 ` Ingo Molnar
2007-09-11 20:04 Ingo Molnar
2007-09-12  0:42 ` Roman Zippel
2007-09-13  7:52   ` Ingo Molnar
2007-09-13 12:35     ` Roman Zippel
2007-09-13 14:28       ` Ingo Molnar
2007-09-13 16:50         ` Roman Zippel
2007-09-13 17:06           ` Peter Zijlstra
2007-09-13 17:09             ` Peter Zijlstra
2007-09-14 12:04             ` Roman Zippel
2007-09-14 12:17               ` Peter Zijlstra
2007-09-13 18:28           ` Kyle Moffett
2007-09-13 19:08             ` Peter Zijlstra
2007-09-14 15:26           ` Arjan van de Ven
2007-09-14 14:50             ` Roman Zippel
2007-09-14 15:56               ` Arjan van de Ven
2007-09-14 15:13                 ` Roman Zippel
2007-09-13 19:01       ` Sam Ravnborg
2007-09-14 12:26         ` Roman Zippel
2007-09-12  1:16 ` Rob Hussey
2007-09-13  8:42   ` Rob Hussey
2007-09-13  9:06     ` Ingo Molnar
2007-09-13  9:24       ` Rob Hussey
2007-09-13  9:31         ` Ingo Molnar
2007-09-13  9:36           ` Rob Hussey
2007-09-13  9:43             ` Rob Hussey
2007-09-13 10:17               ` Rob Hussey
2007-09-13 11:48             ` Ingo Molnar
2007-09-14  1:47               ` Rob Hussey
2007-09-14  2:26                 ` Rob Hussey
2007-09-14  6:59                 ` Kyle Moffett
2007-09-12  6:20 ` Mike Galbraith
2007-09-12 22:17 ` Roman Zippel
2007-09-13  7:17   ` debian developer
2007-09-13  7:34   ` debian developer
2007-09-13  9:19   ` Ingo Molnar
2007-09-13 11:35   ` Peter Zijlstra
2007-09-13 12:14     ` Roman Zippel
2007-09-13 12:44       ` Peter Zijlstra
2007-09-14 11:16         ` Peter Zijlstra
2007-09-13 12:47   ` Ingo Molnar
2007-09-14 11:46     ` Roman Zippel
2007-09-13 23:08   ` Willy Tarreau
2007-09-14 13:10     ` Roman Zippel
2007-09-14 17:54       ` Willy Tarreau

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=1189723870.4485.18.camel@earth \
    --to=dmitry.adamushko@gmail.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=efault@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=zippel@linux-m68k.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.