mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Kenneth Chen" <kenneth.w.chen@intel.com>
To: "'Andrew Morton'" <akpm@osdl.org>
Cc: <linux-kernel@vger.kernel.org>, <linux-ia64@vger.kernel.org>
Subject: RE: add lowpower_idle sysctl
Date: Thu, 18 Mar 2004 13:59:44 -0800	[thread overview]
Message-ID: <200403182159.i2ILxhF12208@unix-os.sc.intel.com> (raw)
In-Reply-To: <20040317192821.1fe90f24.akpm@osdl.org>

>>>>> Andrew Morton wrote on Wed, March 17, 2004 7:28 PM
> > "Kenneth Chen" <kenneth.w.chen@intel.com> wrote:
> >
> >  Writing to sysctl should be a bool, reading the value can be number of
> >  module currently disabled low power idle.  I think the original intent
> >  is to use ref count for enabling/disabling.  (granted, we copied the
> >  code from other arch).
>
> OK, so why not give us:
>
> #define IDLE_HALT			0
> #define IDLE_POLL			1
> #define IDLE_SUPER_LOW_POWER_HALT	2
>
> and so forth (are there any others?).
>
> Set some system-wide integer via a sysctl and let the particular
> architecture decide how best to implement the currently-selected
> idle mode?


Sounds good, Thanks for the suggestion. I just coded it up:


diff -Nur linux-2.6.4/include/linux/cpu.h linux-2.6.4.halt/include/linux/cpu.h
--- linux-2.6.4/include/linux/cpu.h	2004-03-10 18:55:23.000000000 -0800
+++ linux-2.6.4.halt/include/linux/cpu.h	2004-03-18 13:47:43.000000000 -0800
@@ -52,6 +52,12 @@

 #endif /* CONFIG_SMP */
 extern struct sysdev_class cpu_sysdev_class;
+extern int idle_mode;
+
+#define IDLE_NOOP	0
+#define IDLE_HALT	1
+#define IDLE_POLL	2
+#define IDLE_ACPI	3

 #ifdef CONFIG_HOTPLUG_CPU
 /* Stop CPUs going up and down. */
diff -Nur linux-2.6.4/include/linux/sysctl.h linux-2.6.4.halt/include/linux/sysctl.h
--- linux-2.6.4/include/linux/sysctl.h	2004-03-10 18:55:28.000000000 -0800
+++ linux-2.6.4.halt/include/linux/sysctl.h	2004-03-18 12:00:40.000000000 -0800
@@ -131,6 +131,7 @@
 	KERN_PRINTK_RATELIMIT_BURST=61,	/* int: tune printk ratelimiting */
 	KERN_PTY=62,		/* dir: pty driver */
 	KERN_NGROUPS_MAX=63,	/* int: NGROUPS_MAX */
+	KERN_IDLE_MODE=64,	/* int: arch specific cpu idle mode */
 };


diff -Nur linux-2.6.4/kernel/cpu.c linux-2.6.4.halt/kernel/cpu.c
--- linux-2.6.4/kernel/cpu.c	2004-03-10 18:55:44.000000000 -0800
+++ linux-2.6.4.halt/kernel/cpu.c	2004-03-18 13:29:28.000000000 -0800
@@ -64,3 +64,5 @@
 	up(&cpucontrol);
 	return ret;
 }
+
+int idle_mode = IDLE_HALT;
diff -Nur linux-2.6.4/kernel/sysctl.c linux-2.6.4.halt/kernel/sysctl.c
--- linux-2.6.4/kernel/sysctl.c	2004-03-10 18:55:22.000000000 -0800
+++ linux-2.6.4.halt/kernel/sysctl.c	2004-03-18 13:52:27.000000000 -0800
@@ -39,6 +39,7 @@
 #include <linux/initrd.h>
 #include <linux/times.h>
 #include <linux/limits.h>
+#include <linux/cpu.h>
 #include <asm/uaccess.h>

 #ifdef CONFIG_ROOT_NFS
@@ -615,6 +616,14 @@
 		.mode		= 0444,
 		.proc_handler	= &proc_dointvec,
 	},
+	{
+		.ctl_name	= KERN_IDLE_MODE,
+		.procname	= "idle_mode",
+		.data		= &idle_mode,
+		.maxlen		= sizeof (int),
+		.mode		= 0644,
+		.proc_handler	= &proc_dointvec,
+	},
 	{ .ctl_name = 0 }
 };




  parent reply	other threads:[~2004-03-18 22:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-18  0:31 Kenneth Chen
2004-03-18  1:04 ` Andrew Morton
2004-03-18  3:18   ` Kenneth Chen
2004-03-18  3:28     ` Andrew Morton
2004-03-18  3:40       ` Zwane Mwaikambo
2004-03-18  9:05         ` Dominik Brodowski
2004-03-18 18:29           ` Kenneth Chen
2004-03-18 22:59         ` Todd Poynor
2004-03-19  0:09           ` Andrew Morton
2004-03-19  0:43           ` Zwane Mwaikambo
2004-03-25 19:20           ` Chen, Kenneth W
2004-03-18 21:59       ` Kenneth Chen [this message]
2004-03-18 22:35         ` Andrew Morton
2004-03-24  9:54         ` Pavel Machek
2004-03-25 19:04           ` Chen, Kenneth W
2004-03-18  9:42   ` Pasi Savolainen
2004-03-23  9:56 ` Pavel Machek
2004-03-18  7:49 Ross Dickson

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=200403182159.i2ILxhF12208@unix-os.sc.intel.com \
    --to=kenneth.w.chen@intel.com \
    --cc=akpm@osdl.org \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome