public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [ckpatch][15/29] hz-no_default_250.patch
@ 2006-06-18  7:32 Con Kolivas
  2006-06-18  7:42 ` Willy Tarreau
  0 siblings, 1 reply; 10+ messages in thread
From: Con Kolivas @ 2006-06-18  7:32 UTC (permalink / raw)
  To: linux list; +Cc: ck list

Make 250 HZ a value that is not selected by default and give some better
recommendations in help.

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

 kernel/Kconfig.hz |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

Index: linux-ck-dev/kernel/Kconfig.hz
===================================================================
--- linux-ck-dev.orig/kernel/Kconfig.hz	2006-06-18 15:23:58.000000000 +1000
+++ linux-ck-dev/kernel/Kconfig.hz	2006-06-18 15:24:28.000000000 +1000
@@ -21,14 +21,17 @@ choice
 	help
 	  100 HZ is a typical choice for servers, SMP and NUMA systems
 	  with lots of processors that may show reduced performance if
-	  too many timer interrupts are occurring.
+	  too many timer interrupts are occurring. Laptops may also show
+	  improved battery life.
 
-	config HZ_250
+	config HZ_250_NODEFAULT
 		bool "250 HZ"
 	help
-	 250 HZ is a good compromise choice allowing server performance
-	 while also showing good interactive responsiveness even
-	 on SMP and NUMA systems.
+	 250 HZ is a lousy compromise choice allowing server interactivity
+	 while also showing desktop throughput and no extra power saving on
+	 laptops. Good for when you can't make up your mind.
+
+	 Recommend 100 or 1000 instead.
 
 	config HZ_1000
 		bool "1000 HZ"
@@ -41,6 +44,6 @@ endchoice
 config HZ
 	int
 	default 100 if HZ_100
-	default 250 if HZ_250
+	default 250 if HZ_250_NODEFAULT
 	default 1000 if HZ_1000
 

-- 
-ck

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: [ckpatch][15/29] hz-no_default_250.patch
@ 2006-06-19  0:52 Albert Cahalan
  2006-06-19  1:25 ` Con Kolivas
  2006-06-19  1:30 ` Lee Revell
  0 siblings, 2 replies; 10+ messages in thread
From: Albert Cahalan @ 2006-06-19  0:52 UTC (permalink / raw)
  To: linux-kernel, kernel

> Make 250 HZ a value that is not selected by default and give some
> better recommendations in help.

No, 250 is a good default.

We can't reliably do 1000. There are many systems, including both
laptops and servers, which have a BIOS that uses SMM/SMI to grab
the CPU for longer than a millisecond. We'd lose clock ticks if
we had HZ at 1000.

NTSC video is 59.94 fields per second. Though a sample rate of
double that would satisfy the Nyquest theory, in practice you
need to go to 4x to 5x the rate you want. This comes out to be
around 240 to 300 as a minimum.

Then there is the matter of picking a value that is very close
to being an integer factor of the standard PC clock. I don't
remember how well 250 did, but here is the code I once used
to compute such things:

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <float.h>
#include <math.h>

// 1189200.0 // AMD ELAN
// 1193182.0 // normal

#define PITHZ 1193182.0

double nearbyint(double x);

#define TARGET_MAX 1300 // was 15000
#define TARGET_MIN 240  // was 9

int main(int argc, char *argv[]){
  unsigned target = TARGET_MAX;
  while(--target>TARGET_MIN){
st:;
    unsigned setting = nearbyint(PITHZ / target);
    double actual = PITHZ / setting;
    double diff = actual - target;
    double perc = 100.0*diff/target;
//    if(target & 3) continue;
#if 1
    if(target!=1000 && target !=1024 && target!=100 && target!=400 &&
target!=600
      && target!=1200 && target!=240 && target!=300 && target!=800
      && target!=512 && target!=256 && target!=128)
      if(perc > 0.01 || perc < -0.01) continue;
#else
    {
    if(perc>-0.6 && perc<0.6) continue;
    }
#endif
    printf("%+11.8f %+10.6f %6u %5u %12.6f\n", perc, diff, setting,
target, actual);
  }
  if(target>105) {
    target = 100;
    goto st;
  }
  return 0;
}

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

end of thread, other threads:[~2006-06-21  4:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-18  7:32 [ckpatch][15/29] hz-no_default_250.patch Con Kolivas
2006-06-18  7:42 ` Willy Tarreau
2006-06-18 10:08   ` Con Kolivas
2006-06-18 15:03     ` Jan Engelhardt
  -- strict thread matches above, loose matches on Subject: below --
2006-06-19  0:52 Albert Cahalan
2006-06-19  1:25 ` Con Kolivas
2006-06-19 11:52   ` Jan Engelhardt
2006-06-21  4:53     ` Con Kolivas
2006-06-19  1:30 ` Lee Revell
2006-06-19  1:52   ` Con Kolivas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox