public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alok Kataria <akataria@vmware.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: "H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@elte.hu>,
	Thomas Gleixner <tglx@linutronix.de>,
	the arch/x86 maintainers <x86@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] x86: Reduce the default HZ value
Date: Tue, 05 May 2009 16:37:47 -0700	[thread overview]
Message-ID: <1241566667.8665.62.camel@alok-dev1> (raw)
In-Reply-To: <20090505233339.542880f8@lxorguk.ukuu.org.uk>


On Tue, 2009-05-05 at 15:33 -0700, Alan Cox wrote:
> > IMO, one of the main motives of HRT implementation apart from getting
> > higher precision timers was that we now don't necessarily need to rely
> 
> Timer frequency and HZ are two entirely different things nowdyas

Huh ? maybe I am reading this code incorrectly, but this is what I
understand, the APIC is still being programmed to wake HZ time every
second if the system is nonidle (periodic mode). 
Only if the system is idle does the kernel program the APIC in one shot
mode as a result the tickless kernel gives us a lot less pain when the
guest is idle. 

Here are the numbers with a HZ=100 kernel which proves this hypothesis. 

[root@alok-vm-rhel64 ~]# cat /proc/interrupts | grep "timer" ; time
sleep 30 ; cat /proc/interrupts | grep "timer"
  0:         36          0   IO-APIC-edge      timer
LOC:       7549       7176   Local timer interrupts

real    0m30.006s
user    0m0.000s
sys     0m0.000s
  0:         36          0   IO-APIC-edge      timer
LOC:       7616       7209   Local timer interrupts


So in this case when the system is (pretty much) "idle" the total number
of wakeup's are far less just about 65 in the total 30sec on cpu0.

If I run a simple program which does a tight loop, this to check the
behavior when the system is non-idle, 

[root@alok-vm-rhel64 ~]# cat /proc/interrupts | grep "timer" ;
time ./tightloop_short ; cat /proc/interrupts | grep "timer"
  0:         36          0   IO-APIC-edge      timer
LOC:       8008       7453   Local timer interrupts

real    0m30.377s
user    0m30.370s
sys     0m0.000s
  0:         36          0   IO-APIC-edge      timer
LOC:      11049      10493   Local timer interrupts

Here we see that we had a total of ~3000 interrupts. In this case the
system was non-idle and hence the APIC was programmed in periodic mode. 

The tightloop program only does this
 int main()
{
        unsigned long long count;
        while(count++ < 5999999999UL);
        return 0;
}


If I do the same experiments on a HZ=1000 kernel I  see that the number
of interrupts would rise to 30000 in the second case.

I did check that the "apic_timer_irqs" counter - that is read from the
proc file  - is updated only from smp_apic_timer_interrupt code path, so
this can't be a interrupt accounting bug.

In short, I don't believe that HZ and timer frequency are not related
nowadays, please correct me if I am missing anything here. 

> 
> > on a high timer frequency. If you see problems with Desktop feel and
> > responsiveness don't you think there would be other problem which might
> > be causing that ?  Your argument about the "desktop feel and
> > responsiveness" doesn't explain what actual problem did you see.
> 
> People spent months poking at the differences before HZ=1000 became the
> default. It wasn't due for amusement values - but this is irrelevant
> anyway on a modern kernel as HZ=1000 is simply a precision setting that
> affects things like poll()
> 
> HZ on a tickless system has no meaningful relationship to wakup rates -
> which are what I assume you actually care about.

Yes I care about the wakeup rates and as explained above HZ does affect
that.

> 
> So do you want to change the precision of poll() and other
> functionality ? or do you want to change the wakeup rates and
> corresponding virtualisation overhead ?
> 
> If the latter then HZ is not the thing to touch.
> 
> What are you *actually* trying to achieve ?
> What measurements have you done that make you think HZ is relevant in a
> tickless kernel ?
> 
I hope all these questions are answered above.

Thanks,
Alok
> 
> Alan


  reply	other threads:[~2009-05-05 23:37 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-04 18:44 [PATCH] x86: Reduce the default HZ value Alok Kataria
2009-05-05 21:21 ` H. Peter Anvin
2009-05-05 21:44   ` Alan Cox
2009-05-05 22:09     ` Alok Kataria
2009-05-05 22:33       ` Alan Cox
2009-05-05 23:37         ` Alok Kataria [this message]
2009-05-07 14:09         ` Christoph Lameter
2009-05-07 15:12           ` Alan Cox
2009-05-05 21:57   ` Alok Kataria
2009-05-07 14:13     ` Christoph Lameter
2009-05-07 15:14       ` Alan Cox
2009-05-07 15:20         ` Christoph Lameter
2009-05-07 15:30         ` H. Peter Anvin
2009-05-07 15:40           ` Christoph Lameter
2009-05-07 16:55           ` Jeff Garzik
2009-05-07 17:09             ` Alan Cox
2009-05-07 17:55               ` Jeff Garzik
2009-05-07 19:51                 ` Alan Cox
2009-05-07 20:03                   ` Jeff Garzik
2009-05-07 20:30                     ` Alan Cox
2009-05-07 16:37         ` Alok Kataria
2009-05-07 17:07       ` Peter Zijlstra
2009-05-07 17:13         ` Peter Zijlstra
2009-05-07 17:18           ` Peter Zijlstra
2009-05-07 17:20             ` Christoph Lameter
2009-05-07 17:39               ` Peter Zijlstra
2009-05-07 17:40                 ` Christoph Lameter
2009-05-07 17:54               ` Paul E. McKenney
2009-05-07 17:51                 ` Christoph Lameter
2009-05-07 19:51                   ` Paul E. McKenney
2009-05-07 17:36             ` Paul E. McKenney
2009-05-07 17:38               ` Peter Zijlstra
2009-05-07 18:01                 ` Paul E. McKenney
2009-05-07 18:12                   ` Christoph Lameter
2009-05-07 19:06                     ` Paul E. McKenney
2009-05-07 19:53                     ` Alan Cox
2009-05-07 19:56                       ` Christoph Lameter
2009-05-07 20:24                         ` Alan Cox
2009-05-07 20:21                           ` Christoph Lameter
2009-05-08 10:32                   ` Peter Zijlstra
2009-05-08 12:50                     ` Paul E. McKenney
2009-05-08 14:16                       ` Christoph Lameter
2009-05-08 15:06                         ` Paul E. McKenney
2009-05-07 17:18           ` Christoph Lameter
2009-05-07 17:37             ` Peter Zijlstra
2009-05-07 17:34               ` Christoph Lameter
2009-05-07 17:55                 ` Peter Zijlstra
2009-05-07 17:55                   ` Christoph Lameter
2009-05-07 17:19         ` Christoph Lameter
2009-05-07 17:45           ` Peter Zijlstra
2009-05-07 17:50             ` Christoph Lameter
2009-05-07 19:17               ` Peter Zijlstra
2009-05-07 19:38                 ` Christoph Lameter
2009-05-07 21:01             ` H. Peter Anvin
2009-05-07 16:35     ` Chris Snook
2009-05-07 16:56       ` Alok Kataria
2009-05-07 20:29         ` Chris Snook
2009-05-07 20:34           ` Alan Cox
2009-05-07 22:16             ` Ravikiran G Thirumalai
2009-05-07 22:19             ` Alok Kataria
2009-05-08  9:31               ` Alan Cox
  -- strict thread matches above, loose matches on Subject: below --
2009-05-12 19:45 devzero
2009-05-13 23:30 ` Alok Kataria
2009-05-14 20:25 devzero
2009-05-14 20:29 ` Alan Cox

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=1241566667.8665.62.camel@alok-dev1 \
    --to=akataria@vmware.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --cc=x86@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