2005-10-27 23:18:51

by Claudio Scordino

[permalink] [raw]
Subject: The "best" value of HZ

Hi,

during the last years there has been a lot of discussion about the "best"
value of HZ... On i386 was 100, then became 1000, and finally was set to 250.
I'm thinking to do an evaluation of this parameter using different
architectures.

Has anybody thought to give the possibility to modify the value of HZ at boot
time instead of at compile time ? This would allow to easily test different
values on different machines and create a table containing the "best" value
for each architecture... At this moment, instead, we have to recompile the
kernel for each different value :(

Do you think there would be much work to do that ?
Do you think it would be a desired feature the knowledge of the best value for
each architecture with more precision ?

Thanks,

Claudio


2005-10-28 02:04:36

by Luke Yang

[permalink] [raw]
Subject: Re: The "best" value of HZ

yes, our Blackfin CPU (from Analog Device) is team interested in
it. Dynamically modify HZ will be useful when we evaluate the
performance.

On 10/28/05, Claudio Scordino <[email protected]> wrote:
> Hi,
>
> during the last years there has been a lot of discussion about the "best"
> value of HZ... On i386 was 100, then became 1000, and finally was set to 250.
> I'm thinking to do an evaluation of this parameter using different
> architectures.
>
> Has anybody thought to give the possibility to modify the value of HZ at boot
> time instead of at compile time ? This would allow to easily test different
> values on different machines and create a table containing the "best" value
> for each architecture... At this moment, instead, we have to recompile the
> kernel for each different value :(
>
> Do you think there would be much work to do that ?
> Do you think it would be a desired feature the knowledge of the best value for
> each architecture with more precision ?
>
> Thanks,
>
> Claudio
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>

2005-10-28 02:30:13

by Alistair John Strachan

[permalink] [raw]
Subject: Re: The "best" value of HZ

On Friday 28 October 2005 00:18, Claudio Scordino wrote:
> Hi,
>
> during the last years there has been a lot of discussion about the
> "best" value of HZ... On i386 was 100, then became 1000, and finally was
> set to 250. I'm thinking to do an evaluation of this parameter using
> different architectures.
>
> Has anybody thought to give the possibility to modify the value of HZ at
> boot time instead of at compile time ? This would allow to easily test
> different values on different machines and create a table containing the
> "best" value for each architecture... At this moment, instead, we have to
> recompile the kernel for each different value :(
>
> Do you think there would be much work to do that ?
> Do you think it would be a desired feature the knowledge of the best value
> for each architecture with more precision ?

Google for "dynticks". There's obviously an overhead associated with HZ not
being a constant (the compiler cannot optimise many expressions), but the
feature is being worked on nonetheless.

--
Cheers,
Alistair.

'No sense being pessimistic, it probably wouldn't work anyway.'
Third year Computer Science undergraduate.
1F2 55 South Clerk Street, Edinburgh, UK.

2005-10-28 02:27:27

by Randy Dunlap

[permalink] [raw]
Subject: Re: The "best" value of HZ

On Fri, 28 Oct 2005 01:18:41 +0200 Claudio Scordino wrote:

> Hi,
>
> during the last years there has been a lot of discussion about the "best"
> value of HZ... On i386 was 100, then became 1000, and finally was set to 250.
> I'm thinking to do an evaluation of this parameter using different
> architectures.
>
> Has anybody thought to give the possibility to modify the value of HZ at boot
> time instead of at compile time ? This would allow to easily test different
> values on different machines and create a table containing the "best" value
> for each architecture... At this moment, instead, we have to recompile the
> kernel for each different value :(
>
> Do you think there would be much work to do that ?

Not a lot. Could be useful.

> Do you think it would be a desired feature the knowledge of the best value for
> each architecture with more precision ?

In this thread (around 2005-july-14)
Subject: Re: [PATCH] i386: Selectable Frequency of the Timer Interrupt
there was some interest in that, and the beginnings of a patch.
But the dynamic tick patch seems to have sidelined this one.

---
~Randy

2005-10-28 03:56:13

by Lee Revell

[permalink] [raw]
Subject: Re: The "best" value of HZ

On Fri, 2005-10-28 at 03:31 +0100, Alistair John Strachan wrote:
> On Friday 28 October 2005 00:18, Claudio Scordino wrote:
> > Hi,
> >
> > during the last years there has been a lot of discussion about the
> > "best" value of HZ... On i386 was 100, then became 1000, and finally was
> > set to 250. I'm thinking to do an evaluation of this parameter using
> > different architectures.
> >
> > Has anybody thought to give the possibility to modify the value of HZ at
> > boot time instead of at compile time ? This would allow to easily test
> > different values on different machines and create a table containing the
> > "best" value for each architecture... At this moment, instead, we have to
> > recompile the kernel for each different value :(
> >
> > Do you think there would be much work to do that ?
> > Do you think it would be a desired feature the knowledge of the best value
> > for each architecture with more precision ?
>
> Google for "dynticks". There's obviously an overhead associated with HZ not
> being a constant (the compiler cannot optimise many expressions), but the
> feature is being worked on nonetheless.
>

Well Linus had the best idea in that thread (as usual) which was to
implement "dynamic ticks" by leaving HZ a constant, setting it to a high
value, and skipping ticks when idle. Has there been any work in that
direction?

Lee

2005-10-28 04:00:46

by Jesper Juhl

[permalink] [raw]
Subject: Re: The "best" value of HZ

On 10/28/05, Lee Revell <[email protected]> wrote:
> On Fri, 2005-10-28 at 03:31 +0100, Alistair John Strachan wrote:
> > On Friday 28 October 2005 00:18, Claudio Scordino wrote:
> > > Hi,
> > >
> > > during the last years there has been a lot of discussion about the
> > > "best" value of HZ... On i386 was 100, then became 1000, and finally was
> > > set to 250. I'm thinking to do an evaluation of this parameter using
> > > different architectures.
> > >
> > > Has anybody thought to give the possibility to modify the value of HZ at
> > > boot time instead of at compile time ? This would allow to easily test
> > > different values on different machines and create a table containing the
> > > "best" value for each architecture... At this moment, instead, we have to
> > > recompile the kernel for each different value :(
> > >
> > > Do you think there would be much work to do that ?
> > > Do you think it would be a desired feature the knowledge of the best value
> > > for each architecture with more precision ?
> >
> > Google for "dynticks". There's obviously an overhead associated with HZ not
> > being a constant (the compiler cannot optimise many expressions), but the
> > feature is being worked on nonetheless.
> >
>
> Well Linus had the best idea in that thread (as usual) which was to
> implement "dynamic ticks" by leaving HZ a constant, setting it to a high
> value, and skipping ticks when idle. Has there been any work in that
> direction?
>

i did a bit of work in that area, but the stuff I came up with never
seemed to work right, so I dropped it.


--
Jesper Juhl <[email protected]>
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html

2005-10-28 04:27:17

by Con Kolivas

[permalink] [raw]
Subject: Re: The "best" value of HZ

On Fri, 28 Oct 2005 02:00 pm, Jesper Juhl wrote:
> On 10/28/05, Lee Revell <[email protected]> wrote:
> > On Fri, 2005-10-28 at 03:31 +0100, Alistair John Strachan wrote:
> > > On Friday 28 October 2005 00:18, Claudio Scordino wrote:
> > > > Hi,
> > > >
> > > > during the last years there has been a lot of discussion about
> > > > the "best" value of HZ... On i386 was 100, then became 1000, and
> > > > finally was set to 250. I'm thinking to do an evaluation of this
> > > > parameter using different architectures.
> > > >
> > > > Has anybody thought to give the possibility to modify the value of HZ
> > > > at boot time instead of at compile time ? This would allow to easily
> > > > test different values on different machines and create a table
> > > > containing the "best" value for each architecture... At this moment,
> > > > instead, we have to recompile the kernel for each different value :(
> > > >
> > > > Do you think there would be much work to do that ?
> > > > Do you think it would be a desired feature the knowledge of the best
> > > > value for each architecture with more precision ?
> > >
> > > Google for "dynticks". There's obviously an overhead associated with HZ
> > > not being a constant (the compiler cannot optimise many expressions),
> > > but the feature is being worked on nonetheless.
> >
> > Well Linus had the best idea in that thread (as usual) which was to
> > implement "dynamic ticks" by leaving HZ a constant, setting it to a high
> > value, and skipping ticks when idle. Has there been any work in that
> > direction?
>
> i did a bit of work in that area, but the stuff I came up with never
> seemed to work right, so I dropped it.

It's all still in development at the moment but not far from being available
again. We stood back a bit to make some structural changes before trying to
make it ready for prime time.

Cheers,
Con

2005-10-28 21:29:46

by Adrian Bunk

[permalink] [raw]
Subject: Re: The "best" value of HZ

On Fri, Oct 28, 2005 at 01:18:41AM +0200, Claudio Scordino wrote:

> Hi,

Hi Claudio,

> during the last years there has been a lot of discussion about the "best"
> value of HZ... On i386 was 100, then became 1000, and finally was set to 250.
> I'm thinking to do an evaluation of this parameter using different
> architectures.
>
> Has anybody thought to give the possibility to modify the value of HZ at boot
> time instead of at compile time ? This would allow to easily test different
> values on different machines and create a table containing the "best" value
> for each architecture... At this moment, instead, we have to recompile the
> kernel for each different value :(
>
> Do you think there would be much work to do that ?
> Do you think it would be a desired feature the knowledge of the best value for
> each architecture with more precision ?

the best value for HZ is not architecture specific, it depends on the
usage pattern.

The rule is roughly:
- low HZ for computations
- high HZ for interactive usage

Making HZ selectable at boot time wouldn't be hard, but I doubt it's
worth it because it would make the kernel both bigger and slower.

> Thanks,
>
> Claudio

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed