All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: add lowpower_idle sysctl
@ 2004-03-18  7:49 Ross Dickson
  0 siblings, 0 replies; 37+ messages in thread
From: Ross Dickson @ 2004-03-18  7:49 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm, kenneth.w.chen

<snip>
> 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?).

#define IDLE_C1HALT ?
 
I created another one for Athlon Nforce2 to prevent lockups in apic mode.
It is proving more useful than I thought.
It has also been used on SIS740 to prevent same problem.
I know such a workaround should not be required but it works well.

It modifies C1 state idle behaviour by being a little more intelligent about
when it is worthwhile to do into disconnect and has a crude but effective
delay in case of back to back disconnect reconnect cycles.
Recent post.
http://linux.derkeiler.com/Mailing-Lists/Kernel/2004-03/4278.html
Patch is here.
http://linux.derkeiler.com/Mailing-Lists/Kernel/2004-02/6520.html 

Currently it is kernel arg activated by  "idle=C1halt".
 
 > 
 > Set some system-wide integer via a sysctl and let the particular 
 > architecture decide how best to implement the currently-selected idle mode? 
 
A lockup detector on Athlon systems could conceivably invoke above idle state
after a manual reboot as not all systems of the same chipset have the problem.

Ross.


^ permalink raw reply	[flat|nested] 37+ messages in thread
* add lowpower_idle sysctl
@ 2004-03-18  0:31 ` Kenneth Chen
  0 siblings, 0 replies; 37+ messages in thread
From: Kenneth Chen @ 2004-03-18  0:31 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-ia64

On ia64, we need runtime control to manage CPU power state in the idle
loop.  Logically it means a sysctl entry in /proc/sys/kernel.  Even
though this sysctl entry doesn't exist today, lots of arch already has
some sort of API to dynamically enable/disable low power idle state.
Looking at linux-2.6.4, arm, arm26, cris, i386, parisc, sh, um, x86-64
all has very much the same code in each arch.  So instead of replicate
another set under arch/ia64, we are proposing these API to be abstracted
out in the generic code.  And also add a sysctl entry under /proc/sys/kernel.

Would this be useful to all architecture who wants this features?  It
would be a lot less code duplication.

- Ken


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-17 15:33:30.000000000 -0800
@@ -131,6 +131,7 @@
 	KERN_PRINTK_RATELIMIT_BURSTa,	/* int: tune printk ratelimiting */
 	KERN_PTYb,		/* dir: pty driver */
 	KERN_NGROUPS_MAXc,	/* int: NGROUPS_MAX */
+	KERN_LOWPOWER_IDLEd,	/* int: low power idle */
 };


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-17 15:36:32.000000000 -0800
@@ -64,3 +64,15 @@
 	up(&cpucontrol);
 	return ret;
 }
+
+atomic_t halt_counter;
+void enable_halt(void)
+{
+	atomic_dec(&halt_counter);
+}
+void disable_halt(void)
+{
+	atomic_inc(&halt_counter);
+}
+EXPORT_SYMBOL(enable_halt);
+EXPORT_SYMBOL(disable_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-17 15:34:52.000000000 -0800
@@ -64,6 +64,7 @@
 extern int min_free_kbytes;
 extern int printk_ratelimit_jiffies;
 extern int printk_ratelimit_burst;
+extern atomic_t halt_counter;

 /* this is needed for the proc_dointvec_minmax for [fs_]overflow UID and GID */
 static int maxolduid = 65535;
@@ -615,6 +616,14 @@
 		.mode		= 0444,
 		.proc_handler	= &proc_dointvec,
 	},
+	{
+		.ctl_name	= KERN_LOWPOWER_IDLE,
+		.procname	= "lowpower_idle",
+		.data		= &halt_counter,
+		.maxlen		= sizeof (int),
+		.mode		= 0644,
+		.proc_handler	= &proc_dointvec,
+	},
 	{ .ctl_name = 0 }
 };




^ permalink raw reply	[flat|nested] 37+ messages in thread

end of thread, other threads:[~2004-03-25 19:21 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-18  7:49 add lowpower_idle sysctl Ross Dickson
  -- strict thread matches above, loose matches on Subject: below --
2004-03-18  0:31 Kenneth Chen
2004-03-18  0:31 ` Kenneth Chen
2004-03-18  1:04 ` Andrew Morton
2004-03-18  1:04   ` Andrew Morton
2004-03-18  9:42   ` Pasi Savolainen
2004-03-18  3:18 ` Kenneth Chen
2004-03-18  3:18   ` Kenneth Chen
2004-03-18  3:28   ` Andrew Morton
2004-03-18  3:28     ` Andrew Morton
2004-03-18  3:40     ` Zwane Mwaikambo
2004-03-18  3:40       ` Zwane Mwaikambo
2004-03-18  9:05       ` Dominik Brodowski
2004-03-18  9:05         ` Dominik Brodowski
2004-03-18 18:29         ` Kenneth Chen
2004-03-18 18:29           ` Kenneth Chen
2004-03-18 18:29           ` Kenneth Chen
2004-03-18 22:59       ` Todd Poynor
2004-03-18 22:59         ` Todd Poynor
2004-03-19  0:09         ` Andrew Morton
2004-03-19  0:09           ` Andrew Morton
2004-03-19  0:09           ` Andrew Morton
2004-03-19  0:43         ` Zwane Mwaikambo
2004-03-19  0:43           ` Zwane Mwaikambo
2004-03-25 19:20         ` Chen, Kenneth W
2004-03-25 19:20           ` Chen, Kenneth W
2004-03-25 19:20           ` Chen, Kenneth W
2004-03-18 21:59 ` Kenneth Chen
2004-03-18 21:59   ` Kenneth Chen
2004-03-18 22:35   ` Andrew Morton
2004-03-18 22:35     ` Andrew Morton
2004-03-24  9:54   ` Pavel Machek
2004-03-24  9:54     ` Pavel Machek
2004-03-23  9:56 ` Pavel Machek
2004-03-23  9:56   ` Pavel Machek
2004-03-25 19:04 ` Chen, Kenneth W
2004-03-25 19:04   ` Chen, Kenneth W

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.