All of lore.kernel.org
 help / color / mirror / Atom feed
From: Con Kolivas <kernel@kolivas.org>
To: AndrewMorton <akpm@osdl.org>
Cc: "Carlos Carvalho" <carlos@fisica.ufpr.br>,
	ck@vds.kolivas.org, "Ingo Molnar" <mingo@elte.hu>,
	"Markus Törnqvist" <mjt@nysv.org>,
	linux-kernel@vger.kernel.org
Subject: [SMP NICE] [PATCH 2/2] SCHED: Make SMP nice a config option
Date: Wed, 11 May 2005 13:05:48 +1000	[thread overview]
Message-ID: <200505111305.48610.kernel@kolivas.org> (raw)
In-Reply-To: <200505111304.06853.kernel@kolivas.org>

[-- Attachment #1: Type: text/plain, Size: 1 bytes --]



[-- Attachment #2: make_smp_nice_config_option.diff --]
[-- Type: text/x-diff, Size: 15552 bytes --]

Certain configurations may not need the SMP nice balancing scheme and would
prefer SMP balancing to be based purely on throughput. Make SMP nice support
a config option which disables priority bias for SMP balancing and priority
based SMT sibling sleeps.

Signed-off-by: Con Kolivas <kernel@kolivas.org>


Index: linux-2.6.12-rc4-smpnice/arch/alpha/Kconfig
===================================================================
--- linux-2.6.12-rc4-smpnice.orig/arch/alpha/Kconfig	2005-05-11 11:45:42.000000000 +1000
+++ linux-2.6.12-rc4-smpnice/arch/alpha/Kconfig	2005-05-11 12:25:40.000000000 +1000
@@ -498,6 +498,19 @@ config SMP
 
 	  If you don't know what to do here, say N.
 
+config SMP_NICE
+	bool "SMP support for nice levels across cpus"
+	depends on SMP
+	default y
+	---help---
+	  This option supports a degree of unbalancing of cpus according to
+	  processes' nice levels. Disabling this option on dedicated single
+	  purpose servers may improve throughput slightly but cpu resource
+	  sharing according to 'nice' across physical or logical cpus will
+	  be lost.
+
+	  If unsure say Y
+
 config HAVE_DEC_LOCK
 	bool
 	depends on SMP
Index: linux-2.6.12-rc4-smpnice/arch/arm/Kconfig
===================================================================
--- linux-2.6.12-rc4-smpnice.orig/arch/arm/Kconfig	2005-05-11 11:45:42.000000000 +1000
+++ linux-2.6.12-rc4-smpnice/arch/arm/Kconfig	2005-05-11 12:26:21.000000000 +1000
@@ -324,6 +324,19 @@ config SMP
 
 	  If you don't know what to do here, say N.
 
+config SMP_NICE
+	bool "SMP support for nice levels across cpus"
+	depends on SMP
+	default y
+	---help---
+	  This option supports a degree of unbalancing of cpus according to
+	  processes' nice levels. Disabling this option on dedicated single
+	  purpose servers may improve throughput slightly but cpu resource
+	  sharing according to 'nice' across physical or logical cpus will
+	  be lost.
+
+	  If unsure say Y
+
 config NR_CPUS
 	int "Maximum number of CPUs (2-32)"
 	range 2 32
Index: linux-2.6.12-rc4-smpnice/arch/i386/Kconfig
===================================================================
--- linux-2.6.12-rc4-smpnice.orig/arch/i386/Kconfig	2005-05-11 11:45:42.000000000 +1000
+++ linux-2.6.12-rc4-smpnice/arch/i386/Kconfig	2005-05-11 12:26:05.000000000 +1000
@@ -487,6 +487,19 @@ config SMP
 
 	  If you don't know what to do here, say N.
 
+config SMP_NICE
+	bool "SMP support for nice levels across cpus"
+	depends on SMP
+	default y
+	---help---
+	  This option supports a degree of unbalancing of cpus according to
+	  processes' nice levels. Disabling this option on dedicated single
+	  purpose servers may improve throughput slightly but cpu resource
+	  sharing according to 'nice' across physical or logical cpus will
+	  be lost.
+
+	  If unsure say Y
+
 config NR_CPUS
 	int "Maximum number of CPUs (2-255)"
 	range 2 255
Index: linux-2.6.12-rc4-smpnice/arch/ia64/Kconfig
===================================================================
--- linux-2.6.12-rc4-smpnice.orig/arch/ia64/Kconfig	2005-05-11 11:45:42.000000000 +1000
+++ linux-2.6.12-rc4-smpnice/arch/ia64/Kconfig	2005-05-11 12:28:03.000000000 +1000
@@ -253,6 +253,19 @@ config SMP
 
 	  If you don't know what to do here, say N.
 
+config SMP_NICE
+	bool "SMP support for nice levels across cpus"
+	depends on SMP
+	default y
+	---help---
+	  This option supports a degree of unbalancing of cpus according to
+	  processes' nice levels. Disabling this option on dedicated single
+	  purpose servers may improve throughput slightly but cpu resource
+	  sharing according to 'nice' across physical or logical cpus will
+	  be lost.
+
+	  If unsure say Y
+
 config NR_CPUS
 	int "Maximum number of CPUs (2-512)"
 	range 2 512
Index: linux-2.6.12-rc4-smpnice/arch/m32r/Kconfig
===================================================================
--- linux-2.6.12-rc4-smpnice.orig/arch/m32r/Kconfig	2005-03-02 18:37:30.000000000 +1100
+++ linux-2.6.12-rc4-smpnice/arch/m32r/Kconfig	2005-05-11 12:27:56.000000000 +1000
@@ -241,6 +241,19 @@ config SMP
 
 	  If you don't know what to do here, say N.
 
+config SMP_NICE
+	bool "SMP support for nice levels across cpus"
+	depends on SMP
+	default y
+	---help---
+	  This option supports a degree of unbalancing of cpus according to
+	  processes' nice levels. Disabling this option on dedicated single
+	  purpose servers may improve throughput slightly but cpu resource
+	  sharing according to 'nice' across physical or logical cpus will
+	  be lost.
+
+	  If unsure say Y
+
 config CHIP_M32700_TS1
 	bool "Workaround code for the M32700 TS1 chip's bug"
 	depends on (CHIP_M32700 && SMP)
Index: linux-2.6.12-rc4-smpnice/arch/mips/Kconfig
===================================================================
--- linux-2.6.12-rc4-smpnice.orig/arch/mips/Kconfig	2005-05-11 11:45:42.000000000 +1000
+++ linux-2.6.12-rc4-smpnice/arch/mips/Kconfig	2005-05-11 12:27:48.000000000 +1000
@@ -1438,6 +1438,19 @@ config SMP
 
 	  If you don't know what to do here, say N.
 
+config SMP_NICE
+	bool "SMP support for nice levels across cpus"
+	depends on SMP
+	default y
+	---help---
+	  This option supports a degree of unbalancing of cpus according to
+	  processes' nice levels. Disabling this option on dedicated single
+	  purpose servers may improve throughput slightly but cpu resource
+	  sharing according to 'nice' across physical or logical cpus will
+	  be lost.
+
+	  If unsure say Y
+
 config NR_CPUS
 	int "Maximum number of CPUs (2-64)"
 	range 2 64
Index: linux-2.6.12-rc4-smpnice/arch/parisc/Kconfig
===================================================================
--- linux-2.6.12-rc4-smpnice.orig/arch/parisc/Kconfig	2005-05-11 11:45:42.000000000 +1000
+++ linux-2.6.12-rc4-smpnice/arch/parisc/Kconfig	2005-05-11 12:27:40.000000000 +1000
@@ -143,6 +143,19 @@ config SMP
 
 	  If you don't know what to do here, say N.
 
+config SMP_NICE
+	bool "SMP support for nice levels across cpus"
+	depends on SMP
+	default y
+	---help---
+	  This option supports a degree of unbalancing of cpus according to
+	  processes' nice levels. Disabling this option on dedicated single
+	  purpose servers may improve throughput slightly but cpu resource
+	  sharing according to 'nice' across physical or logical cpus will
+	  be lost.
+
+	  If unsure say Y
+
 config HOTPLUG_CPU
 	bool
 	default y if SMP
Index: linux-2.6.12-rc4-smpnice/arch/ppc/Kconfig
===================================================================
--- linux-2.6.12-rc4-smpnice.orig/arch/ppc/Kconfig	2005-05-11 11:45:42.000000000 +1000
+++ linux-2.6.12-rc4-smpnice/arch/ppc/Kconfig	2005-05-11 12:27:32.000000000 +1000
@@ -882,6 +882,19 @@ config SMP
 
 	  If you don't know what to do here, say N.
 
+config SMP_NICE
+	bool "SMP support for nice levels across cpus"
+	depends on SMP
+	default y
+	---help---
+	  This option supports a degree of unbalancing of cpus according to
+	  processes' nice levels. Disabling this option on dedicated single
+	  purpose servers may improve throughput slightly but cpu resource
+	  sharing according to 'nice' across physical or logical cpus will
+	  be lost.
+
+	  If unsure say Y
+
 config IRQ_ALL_CPUS
 	bool "Distribute interrupts on all CPUs by default"
 	depends on SMP
Index: linux-2.6.12-rc4-smpnice/arch/ppc64/Kconfig
===================================================================
--- linux-2.6.12-rc4-smpnice.orig/arch/ppc64/Kconfig	2005-05-11 11:45:42.000000000 +1000
+++ linux-2.6.12-rc4-smpnice/arch/ppc64/Kconfig	2005-05-11 12:27:26.000000000 +1000
@@ -185,6 +185,19 @@ config SMP
 
 	  If you don't know what to do here, say Y.
 
+config SMP_NICE
+	bool "SMP support for nice levels across cpus"
+	depends on SMP
+	default y
+	---help---
+	  This option supports a degree of unbalancing of cpus according to
+	  processes' nice levels. Disabling this option on dedicated single
+	  purpose servers may improve throughput slightly but cpu resource
+	  sharing according to 'nice' across physical or logical cpus will
+	  be lost.
+
+	  If unsure say Y
+
 config NR_CPUS
 	int "Maximum number of CPUs (2-128)"
 	range 2 128
Index: linux-2.6.12-rc4-smpnice/arch/s390/Kconfig
===================================================================
--- linux-2.6.12-rc4-smpnice.orig/arch/s390/Kconfig	2005-05-11 11:45:42.000000000 +1000
+++ linux-2.6.12-rc4-smpnice/arch/s390/Kconfig	2005-05-11 12:27:19.000000000 +1000
@@ -70,6 +70,19 @@ config SMP
 
 	  Even if you don't know what to do here, say Y.
 
+config SMP_NICE
+	bool "SMP support for nice levels across cpus"
+	depends on SMP
+	default y
+	---help---
+	  This option supports a degree of unbalancing of cpus according to
+	  processes' nice levels. Disabling this option on dedicated single
+	  purpose servers may improve throughput slightly but cpu resource
+	  sharing according to 'nice' across physical or logical cpus will
+	  be lost.
+
+	  If unsure say Y
+
 config NR_CPUS
 	int "Maximum number of CPUs (2-64)"
 	range 2 64
Index: linux-2.6.12-rc4-smpnice/arch/sh/Kconfig
===================================================================
--- linux-2.6.12-rc4-smpnice.orig/arch/sh/Kconfig	2005-05-11 11:45:42.000000000 +1000
+++ linux-2.6.12-rc4-smpnice/arch/sh/Kconfig	2005-05-11 12:27:10.000000000 +1000
@@ -605,6 +605,19 @@ config SMP
 
 	  If you don't know what to do here, say N.
 
+config SMP_NICE
+	bool "SMP support for nice levels across cpus"
+	depends on SMP
+	default y
+	---help---
+	  This option supports a degree of unbalancing of cpus according to
+	  processes' nice levels. Disabling this option on dedicated single
+	  purpose servers may improve throughput slightly but cpu resource
+	  sharing according to 'nice' across physical or logical cpus will
+	  be lost.
+
+	  If unsure say Y
+
 config NR_CPUS
 	int "Maximum number of CPUs (2-32)"
 	range 2 32
Index: linux-2.6.12-rc4-smpnice/arch/sparc/Kconfig
===================================================================
--- linux-2.6.12-rc4-smpnice.orig/arch/sparc/Kconfig	2005-03-02 18:37:30.000000000 +1100
+++ linux-2.6.12-rc4-smpnice/arch/sparc/Kconfig	2005-05-11 12:27:00.000000000 +1000
@@ -105,6 +105,19 @@ config SMP
 
 	  If you don't know what to do here, say N.
 
+config SMP_NICE
+	bool "SMP support for nice levels across cpus"
+	depends on SMP
+	default y
+	---help---
+	  This option supports a degree of unbalancing of cpus according to
+	  processes' nice levels. Disabling this option on dedicated single
+	  purpose servers may improve throughput slightly but cpu resource
+	  sharing according to 'nice' across physical or logical cpus will
+	  be lost.
+
+	  If unsure say Y
+
 config NR_CPUS
 	int "Maximum number of CPUs (2-32)"
 	range 2 32
Index: linux-2.6.12-rc4-smpnice/arch/sparc64/Kconfig
===================================================================
--- linux-2.6.12-rc4-smpnice.orig/arch/sparc64/Kconfig	2005-05-11 11:45:42.000000000 +1000
+++ linux-2.6.12-rc4-smpnice/arch/sparc64/Kconfig	2005-05-11 12:26:51.000000000 +1000
@@ -144,6 +144,19 @@ config SMP
 
 	  If you don't know what to do here, say N.
 
+config SMP_NICE
+	bool "SMP support for nice levels across cpus"
+	depends on SMP
+	default y
+	---help---
+	  This option supports a degree of unbalancing of cpus according to
+	  processes' nice levels. Disabling this option on dedicated single
+	  purpose servers may improve throughput slightly but cpu resource
+	  sharing according to 'nice' across physical or logical cpus will
+	  be lost.
+
+	  If unsure say Y
+
 config PREEMPT
 	bool "Preemptible Kernel"
 	help
Index: linux-2.6.12-rc4-smpnice/arch/um/Kconfig
===================================================================
--- linux-2.6.12-rc4-smpnice.orig/arch/um/Kconfig	2005-05-11 11:45:42.000000000 +1000
+++ linux-2.6.12-rc4-smpnice/arch/um/Kconfig	2005-05-11 12:26:34.000000000 +1000
@@ -211,6 +211,19 @@ config SMP
 
 	If you don't know what to do, say N.
 
+config SMP_NICE
+	bool "SMP support for nice levels across cpus"
+	depends on SMP
+	default y
+	---help---
+	  This option supports a degree of unbalancing of cpus according to
+	  processes' nice levels. Disabling this option on dedicated single
+	  purpose servers may improve throughput slightly but cpu resource
+	  sharing according to 'nice' across physical or logical cpus will
+	  be lost.
+
+	  If unsure say Y
+
 config NR_CPUS
 	int "Maximum number of CPUs (2-32)"
 	range 2 32
Index: linux-2.6.12-rc4-smpnice/arch/x86_64/Kconfig
===================================================================
--- linux-2.6.12-rc4-smpnice.orig/arch/x86_64/Kconfig	2005-05-11 11:45:42.000000000 +1000
+++ linux-2.6.12-rc4-smpnice/arch/x86_64/Kconfig	2005-05-11 12:25:02.000000000 +1000
@@ -207,6 +207,19 @@ config SMP
 
 	  If you don't know what to do here, say N.
 
+config SMP_NICE
+	bool "SMP support for nice levels across cpus"
+	depends on SMP
+	default y
+	---help---
+	  This option supports a degree of unbalancing of cpus according to
+	  processes' nice levels. Disabling this option on dedicated single
+	  purpose servers may improve throughput slightly but cpu resource
+	  sharing according to 'nice' across physical or logical cpus will
+	  be lost.
+
+	  If unsure say Y
+
 config PREEMPT
 	bool "Preemptible Kernel"
 	---help---
Index: linux-2.6.12-rc4-smpnice/kernel/sched.c
===================================================================
--- linux-2.6.12-rc4-smpnice.orig/kernel/sched.c	2005-05-11 12:20:45.000000000 +1000
+++ linux-2.6.12-rc4-smpnice/kernel/sched.c	2005-05-11 12:29:15.000000000 +1000
@@ -605,7 +605,7 @@ static int effective_prio(task_t *p)
 	return prio;
 }
 
-#ifdef CONFIG_SMP
+#ifdef CONFIG_SMP_NICE
 static inline void inc_prio_bias(runqueue_t *rq, int static_prio)
 {
 	rq->prio_bias += MAX_PRIO - static_prio;
@@ -615,7 +615,7 @@ static inline void dec_prio_bias(runqueu
 {
 	rq->prio_bias -= MAX_PRIO - static_prio;
 }
-#else
+#else	/* !CONFIG_SMP_NICE */
 static inline void inc_prio_bias(runqueue_t *rq, int static_prio)
 {
 }
@@ -925,6 +925,7 @@ static inline unsigned long source_load(
 	unsigned long cpu_load = rq->cpu_load,
 		load_now = rq->nr_running * SCHED_LOAD_SCALE;
 
+#ifdef CONFIG_SMP_NICE
 	if (idle == NOT_IDLE) {
 		/*
 		 * If we are balancing busy runqueues the load is biased by
@@ -933,6 +934,7 @@ static inline unsigned long source_load(
 		cpu_load *= rq->prio_bias;
 		load_now *= rq->prio_bias;
 	}
+#endif
 	return min(cpu_load, load_now);
 }
 
@@ -945,10 +947,12 @@ static inline unsigned long target_load(
 	unsigned long cpu_load = rq->cpu_load,
 		load_now = rq->nr_running * SCHED_LOAD_SCALE;
 
+#ifdef CONFIG_SMP_NICE
 	if (idle == NOT_IDLE) {
 		cpu_load *= rq->prio_bias;
 		load_now *= rq->prio_bias;
 	}
+#endif
 	return max(cpu_load, load_now);
 }
 
@@ -2255,7 +2259,7 @@ static inline void idle_balance(int cpu,
 static inline int wake_priority_sleeper(runqueue_t *rq)
 {
 	int ret = 0;
-#ifdef CONFIG_SCHED_SMT
+#if defined(CONFIG_SCHED_SMT) && defined(CONFIG_SMP_NICE)
 	spin_lock(&rq->lock);
 	/*
 	 * If an SMT sibling task has been put to sleep for priority
@@ -2491,7 +2495,7 @@ out:
 	rebalance_tick(cpu, rq, NOT_IDLE);
 }
 
-#ifdef CONFIG_SCHED_SMT
+#if defined(CONFIG_SCHED_SMT) && defined(CONFIG_SMP_NICE)
 static inline void wake_sleeping_dependent(int this_cpu, runqueue_t *this_rq)
 {
 	struct sched_domain *sd = this_rq->sd;
@@ -2605,7 +2609,7 @@ out_unlock:
 		spin_unlock(&cpu_rq(i)->lock);
 	return ret;
 }
-#else
+#else	/* !(CONFIG_SCHED_SMT && CONFIG_SMP_NICE) */
 static inline void wake_sleeping_dependent(int this_cpu, runqueue_t *this_rq)
 {
 }

  reply	other threads:[~2005-05-11  3:06 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-07 13:42 [PATCH] implement nice support across physical cpus on SMP Con Kolivas
2005-05-07 17:59 ` Carlos Carvalho
2005-05-07 21:45   ` Con Kolivas
2005-05-09 11:24 ` Markus   Törnqvist
2005-05-09 11:28   ` [ck] " Markus   Törnqvist
2005-05-09 11:47   ` Con Kolivas
2005-05-09 18:55     ` Markus   Törnqvist
2005-05-09 23:54     ` Carlos Carvalho
2005-05-11  2:56       ` Con Kolivas
2005-05-11  3:04       ` [SMP NICE] [PATCH 1/2] SCHED: Implement " Con Kolivas
2005-05-11  3:05         ` Con Kolivas [this message]
2005-05-11  7:20           ` [SMP NICE] [PATCH 2/2] SCHED: Make SMP nice a config option Ingo Molnar
2005-05-12 10:49             ` Con Kolivas
2005-05-16 11:33         ` [SMP NICE] [PATCH] SCHED: Implement nice support across physical cpus on SMP Con Kolivas
2005-05-16 18:31           ` Markus   Törnqvist
2005-05-17 13:39           ` Carlos Carvalho
2005-05-18 11:30             ` Markus   Törnqvist
2005-05-18 13:45               ` Con Kolivas
2005-05-21  5:00                 ` Con Kolivas
2005-05-23  9:28                   ` [PATCH] SCHED: change_prio_bias_only_if_queued Con Kolivas
2005-05-23 10:07                     ` [PATCH] SCHED: account_rt_tasks_in_prio_bias Con Kolivas

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=200505111305.48610.kernel@kolivas.org \
    --to=kernel@kolivas.org \
    --cc=akpm@osdl.org \
    --cc=carlos@fisica.ufpr.br \
    --cc=ck@vds.kolivas.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mjt@nysv.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.