linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: hejianet <hejianet@gmail.com>, linuxppc-dev@lists.ozlabs.org
Cc: linux-kernel@vger.kernel.org, Paul Mackerras <paulus@samba.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Ingo Molnar <mingo@kernel.org>,
	fweisbec@gmail.com, Thomas Gleixner <tglx@linutronix.de>,
	John Stultz <john.stultz@linaro.org>,
	Stanislaw Gruszka <sgruszka@redhat.com>,
	Ivan Mikhaylov <ivan@de.ibm.com>,
	cyrilbur@gmail.com
Subject: Re: [PATCH] powerpc/time: use get_tb instead of get_vtb in running_clock
Date: Fri, 14 Jul 2017 06:50:30 +1000	[thread overview]
Message-ID: <1499979030.2865.62.camel@kernel.crashing.org> (raw)
In-Reply-To: <946976cd-ca8b-7d26-d316-aeaab44beb04@gmail.com>

On Thu, 2017-07-13 at 14:55 +0800, hejianet wrote:
> Hi Ben
> I add some printk logs in watchdog_timer_fn in the guest
> [   16.025222] get_vtb=8236291881, get_tb=13756711357, get_timestamp=4
> [   20.025624] get_vtb=9745285807, get_tb=15804711283, get_timestamp=7
> [   24.025042] get_vtb=11518119641, get_tb=17852711085, get_timestamp=10
> [   28.024074] get_vtb=13192704319, get_tb=19900711071, get_timestamp=13
> [   32.024086] get_vtb=14856516982, get_tb=21948711066, get_timestamp=16
> [   36.024075] get_vtb=16569127618, get_tb=23996711078, get_timestamp=20
> [   40.024138] get_vtb=17008865823, get_tb=26044718418, get_timestamp=20
> [   44.023993] get_vtb=17020637241, get_tb=28092716383, get_timestamp=20
> [   48.023996] get_vtb=17022857170, get_tb=30140718472, get_timestamp=20
> [   52.023996] get_vtb=17024268541, get_tb=32188718432, get_timestamp=20
> [   56.023996] get_vtb=17036577783, get_tb=34236718077, get_timestamp=20
> [   60.023996] get_vtb=17037829743, get_tb=36284718437, get_timestamp=20
> [   64.023992] get_vtb=17039846747, get_tb=38332716609, get_timestamp=20
> [   68.023991] get_vtb=17041448345, get_tb=40380715903, get_timestamp=20
> 
> The get_timestamp(use get_vtb(),unit is second) is slower down compared
> with printk time. You also can obviously watch the get_vtb increment is
> slowly less than get_tb increment.

But that is the entire point of vtb ... because it only counts when
running in the guest, not the time spent in the host.

> Without this patch, I thought there might be some softlockup warnings
> missed in guest.

Ugh ? We already have too many of these ! On the contrary, we don't
want the guest to start to spew soft lockup warnings because it was not
scheduled by the host enough. The guest soft lockup warnings should be
specifically about something bad happening inside the guest.

Your patch seems to defeat the whole purpose of that running_clock()
function unless I'm somewhat mistaken.

Ben.

      reply	other threads:[~2017-07-13 21:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-12 15:01 [PATCH] powerpc/time: use get_tb instead of get_vtb in running_clock Jia He
2017-07-12 22:45 ` Benjamin Herrenschmidt
2017-07-13  6:55   ` hejianet
2017-07-13 20:50     ` Benjamin Herrenschmidt [this message]

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=1499979030.2865.62.camel@kernel.crashing.org \
    --to=benh@kernel.crashing.org \
    --cc=cyrilbur@gmail.com \
    --cc=fweisbec@gmail.com \
    --cc=hejianet@gmail.com \
    --cc=ivan@de.ibm.com \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mingo@kernel.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.org \
    --cc=sgruszka@redhat.com \
    --cc=tglx@linutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).