All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: mingo@kernel.org, wanpeng.li@hotmail.com,
	linux-kernel@vger.kernel.org, peterz@infradead.org,
	efault@gmx.de, tglx@linutronix.de, rkrcmar@redhat.com,
	torvalds@linux-foundation.org, hpa@zytor.com,
	pbonzini@redhat.com, riel@redhat.com
Cc: linux-tip-commits@vger.kernel.org
Subject: Re: [tip:sched/core] sched/cputime: Resync steal time when guest & host lose sync
Date: Thu, 18 Aug 2016 14:42:31 +0200	[thread overview]
Message-ID: <20160818124229.GC22490@lerouge> (raw)
In-Reply-To: <tip-03cbc732639ddcad15218c4b2046d255851ff1e3@git.kernel.org>

On Thu, Aug 18, 2016 at 03:55:39AM -0700, tip-bot for Wanpeng Li wrote:
> Commit-ID:  03cbc732639ddcad15218c4b2046d255851ff1e3
> Gitweb:     http://git.kernel.org/tip/03cbc732639ddcad15218c4b2046d255851ff1e3
> Author:     Wanpeng Li <wanpeng.li@hotmail.com>
> AuthorDate: Wed, 17 Aug 2016 10:05:46 +0800
> Committer:  Ingo Molnar <mingo@kernel.org>
> CommitDate: Thu, 18 Aug 2016 11:19:48 +0200
> 
> sched/cputime: Resync steal time when guest & host lose sync
> 
> Commit:
> 
>   57430218317e ("sched/cputime: Count actually elapsed irq & softirq time")
> 
> ... fixed a bug but also triggered a regression:
> 
> On an i5 laptop, 4 pCPUs, 4vCPUs for one full dynticks guest, there are four
> CPU hog processes(for loop) running in the guest, I hot-unplug the pCPUs
> on host one by one until there is only one left, then observe CPU utilization
> via 'top' in the guest, it shows:
> 
>   100% st for cpu0(housekeeping)
>    75% st for other CPUs (nohz full mode)
> 
> However, w/o this commit it shows the correct 75% for all four CPUs.
> 
> When a guest is interrupted for a longer amount of time, missed clock ticks
> are not redelivered later. Because of that, we should not limit the amount
> of steal time accounted to the amount of time that the calling functions
> think have passed.
> 
> However, the interval returned by account_other_time() is NOT rounded down
> to the nearest jiffy, while the base interval in get_vtime_delta() it is
> subtracted from is, so the max cputime limit is required to avoid underflow.
> 
> This patch fixes the regression by limiting the account_other_time() from
> get_vtime_delta() to avoid underflow, and lets the other three call sites
> (in account_other_time() and steal_account_process_time()) account however
> much steal time the host told us elapsed.
> 
> Suggested-by: Rik van Riel <riel@redhat.com>
> Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
> Reviewed-by: Rik van Riel <riel@redhat.com>
> Cc: Frederic Weisbecker <fweisbec@gmail.com>

ACK, thanks Wanpeng Li!

      reply	other threads:[~2016-08-18 12:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-17  2:05 [PATCH v3] sched/cputime: Resync steal time when guest & host lose sync Wanpeng Li
2016-08-17  2:15 ` Rik van Riel
2016-08-18 10:55 ` [tip:sched/core] " tip-bot for Wanpeng Li
2016-08-18 12:42   ` Frederic Weisbecker [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=20160818124229.GC22490@lerouge \
    --to=fweisbec@gmail.com \
    --cc=efault@gmx.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.org \
    --cc=riel@redhat.com \
    --cc=rkrcmar@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=wanpeng.li@hotmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.