HZ value change groundings (Was: jitterless touchscreen input in .34)

Gennady Kupava gb at bsdmn.com
Mon Oct 25 11:14:51 CEST 2010


В Пнд, 25/10/2010 в 09:15 +0200, Riccardo Magliocchetti пишет: 
> Il 24/10/2010 20:10, Gennady Kupava ha scritto:
> > В Вск, 24/10/2010 в 19:34 +0200, Radek Polak пишет:
> >> You wrote:>  В Чтв, 21/10/2010 в 22:04 +0200, Radek Polak пишет:
> >>
> >>> 3. i wish 100HZ patch included to qtmoko
> >>> (http://www.bsdmn.com/openmoko/kernel/0001-Use-100-as-HZ-value-on-S3C24XX.p
> >>> atch)
> >>
> >> Oki, i can try, is there any description for the patch? E.g. What does it do
> >> and how can i test it?
> >
> > It does simple thing - change HZ value of linux kernel from 200HZ to
> > 100HZ. Main reason is performance.
> >
> > My rationale is following:
> > Basically this mean that timer interrupts amount will be reduced from
> > 200 per second to 100 per second. This allows:
> >
> > Pros:
> > 1. Stay more in IDLE state. (less power consumption)
> 
> I think that this is something that would be more noticeable with Vasily's
> "S3C24xx GENERIC_TIME / GENERIC_CLOCKEVENT support" patch.

This is not so trivial changes as in HZ patch.

> 
> > 2. If several tasks are active, do 2 times less context switches (and
> > our context switches are expensive). Do not think it will be 'slow'.
> > This is not applied to all tasks - but only to CPU bound ones.
> > 3. Less interrupts is good on it's own.
> >
> > Cons:
> > 1. Worse granilarity of delays and sheduled works. I think it's
> > impossible
> > 2. May reveal some bugs, as any new non-trivial system-wide change.
> > Basically it works here, but i didn't test everything.
> >
> > Other arguments:
> > I checked other boards config files and it turned out that only few of
> > them (10% or so) using 200 as HZ value.
> >
> > I did lmbenching and found that difference is few percent, but still
> > noticeable.
> >
> > I can't 'feel' that something changed.

Here, I mean that I can't feel any difference while using system with
100HZ timer. Main purpose of high HZ is to make task switching so fast
so human can't notice it. From performance point of view, HZ of 10 will
be ok most purposes and will bring more performance over time than HZ of
100. But human will notice such HZ with any interactive session. So, if
I can't feel it - it is good, as this means that this HZ change only
brings performance benefits.

> 
> Has anyone investigated gathering some data with ftrace? examples start 
> from line 246.
> 
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/trace/ftrace.txt;h=557c1edeccaf72535464298743cddd3c8eb01bea;hb=HEAD

Oh... Seem it can provide tons of data about context switches, latency
and preemption and help find out many possible problems. Surely worth
trying.

> 
> >
> > So, this patch is just sets new value for HZ and changes s3c timer
> > interrupt frequency.
> 
> Wouldn't something like that in arch/arm/Kconfig avoid changes in 
> arch/arm/plat-samsung/time.c?
> 
> default 100 if ARCH_S3C2410
> 
> Just asking :)

All changes are in function specific to S3C2410. (It's not ok than code
has set of magic numbers of course, but this is other problem, yes? ;)

Regards,
Gennady 




More information about the openmoko-kernel mailing list