mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christoph Lameter <clameter@sgi.com>
To: akpm@osdl.org
Cc: Peter Williams <pwil3058@bigpond.net.au>,
	linux-kernel@vger.kernel.org,
	Nick Piggin <nickpiggin@yahoo.com.au>,
	Christoph Lameter <clameter@sgi.com>,
	"Siddha, Suresh B" <suresh.b.siddha@intel.com>,
	"Chen, Kenneth W" <kenneth.w.chen@intel.com>,
	Ingo Molnar <mingo@elte.hu>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Subject: [DEBUG] Add a few scheduler event counters
Date: Tue, 14 Nov 2006 12:33:43 -0800 (PST)	[thread overview]
Message-ID: <20061114203343.12761.47566.sendpatchset@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <20061114203256.12761.33911.sendpatchset@schroedinger.engr.sgi.com>

[DEBUG] Some additional VM counters

Add a few counters to be able to see how the softirq affects the
scheduler. This patch should not go into mainline and maybe also
not into mm.

New counters in /proc/vmstat

sched_tick_balance	Ticks that required invokation of the softirq
sched_tick_no_balance	Ticks that did not require the softirq
sched_load_balance	# invocations of load_balance().
sched_balance_softirq	# of softirq executions
sched_balance_running	# of times that serialization prevented
			load balancing of a sched_domain.


Signed-off-by: Christoph Lameter <clameter@sgi.com>

Index: linux-2.6.19-rc5-mm1/include/linux/vmstat.h
===================================================================
--- linux-2.6.19-rc5-mm1.orig/include/linux/vmstat.h	2006-11-13 19:04:08.000000000 -0600
+++ linux-2.6.19-rc5-mm1/include/linux/vmstat.h	2006-11-13 19:06:12.308571232 -0600
@@ -47,6 +47,8 @@ enum vm_event_item { PGPGIN, PGPGOUT, PS
 		FOR_ALL_ZONES(PGSCAN_DIRECT),
 		PGINODESTEAL, SLABS_SCANNED, KSWAPD_STEAL, KSWAPD_INODESTEAL,
 		PAGEOUTRUN, ALLOCSTALL, PGROTATED,
+		SCHED_TICK_NO_BALANCE, SCHED_TICK_BALANCE, SCHED_BALANCE_SOFTIRQ,
+		SCHED_LOAD_BALANCE, SCHED_BALANCE_RUNNING,
 		NR_VM_EVENT_ITEMS
 };
 
Index: linux-2.6.19-rc5-mm1/kernel/sched.c
===================================================================
--- linux-2.6.19-rc5-mm1.orig/kernel/sched.c	2006-11-13 19:06:01.000000000 -0600
+++ linux-2.6.19-rc5-mm1/kernel/sched.c	2006-11-13 19:06:12.405259200 -0600
@@ -2900,6 +2900,8 @@ static void run_rebalance_domains(struct
 	/* Earliest time when we have to call run_rebalance_domains again */
 	unsigned long next_balance = jiffies + 60*HZ;
 
+	__count_vm_event(SCHED_BALANCE_SOFTIRQ);
+
 	for_each_domain(this_cpu, sd) {
 		if (!(sd->flags & SD_LOAD_BALANCE))
 			continue;
@@ -2914,11 +2916,14 @@ static void run_rebalance_domains(struct
 			interval = 1;
 
 		if (sd->flags & SD_SERIALIZE) {
-			if (!spin_trylock(&balancing))
+			if (!spin_trylock(&balancing)) {
+				__count_vm_event(SCHED_BALANCE_RUNNING);
 				goto out;
+			}
 		}
 
 		if (time_after_eq(jiffies, sd->last_balance + interval)) {
+			__count_vm_event(SCHED_LOAD_BALANCE);
 			if (load_balance(this_cpu, this_rq, sd, idle)) {
 				/*
 				 * We've pulled tasks over so either we're no
@@ -3188,8 +3193,11 @@ void scheduler_tick(void)
 		task_running_tick(rq, p);
 #ifdef CONFIG_SMP
 	update_load(rq);
-	if (time_after_eq(jiffies, rq->next_balance))
+	if (time_after_eq(jiffies, rq->next_balance)) {
+		__count_vm_event(SCHED_TICK_BALANCE);
 		raise_softirq(SCHED_SOFTIRQ);
+	}
+		__count_vm_event(SCHED_TICK_NO_BALANCE);
 #endif
 }
 
Index: linux-2.6.19-rc5-mm1/mm/vmstat.c
===================================================================
--- linux-2.6.19-rc5-mm1.orig/mm/vmstat.c	2006-11-13 19:04:08.000000000 -0600
+++ linux-2.6.19-rc5-mm1/mm/vmstat.c	2006-11-13 19:06:12.560545937 -0600
@@ -509,6 +509,11 @@ static char *vmstat_text[] = {
 	"allocstall",
 
 	"pgrotated",
+	"sched_tick_no_balance",
+	"sched_tick_balance",
+	"sched_balance_softirq",
+	"sched_load_balance",
+	"sched_balance_running",
 #endif
 };
 

      parent reply	other threads:[~2006-11-14 20:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-14 20:32 [PATCH 0/8] sched_domain balancing via softirq V4 Christoph Lameter
2006-11-14 20:33 ` [PATCH 1/8] Avoid taking rq lock in wake_priority_sleeper Christoph Lameter
2006-11-14 20:33 ` [PATCH 2/8] Remove staggering of load balancing Christoph Lameter
2006-11-14 20:33 ` [PATCH 3/8] Disable interrupts for locking in load_balance() Christoph Lameter
2006-11-14 20:33 ` [PATCH 4/8] Extract load calculation from rebalance_tick Christoph Lameter
2006-11-14 20:33 ` [PATCH 5/8] Move idle status calculation into rebalance_tick() Christoph Lameter
2006-11-14 20:33 ` [PATCH 6/8] Use softirq for load balancing Christoph Lameter
2006-11-14 20:33 ` [PATCH 7/8] Call tasklet less frequently Christoph Lameter
2006-11-14 20:33 ` [PATCH 8/8] Add option to serialize load balancing Christoph Lameter
2006-11-14 20:33 ` Christoph Lameter [this message]

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=20061114203343.12761.47566.sendpatchset@schroedinger.engr.sgi.com \
    --to=clameter@sgi.com \
    --cc=akpm@osdl.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=kenneth.w.chen@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=nickpiggin@yahoo.com.au \
    --cc=pwil3058@bigpond.net.au \
    --cc=suresh.b.siddha@intel.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

Powered by JetHome