]> git.baikalelectronics.ru Git - kernel.git/commit
xen: Fix x86 sched_clock() interface for xen
authorJuergen Gross <jgross@suse.com>
Mon, 14 Jan 2019 12:44:13 +0000 (13:44 +0100)
committerBoris Ostrovsky <boris.ostrovsky@oracle.com>
Wed, 16 Jan 2019 18:06:05 +0000 (13:06 -0500)
commit5318470d41a87ea97f12c308927738aaaefb15e9
tree2f343419e8513ee2cba477e262b4ba7fde507f03
parent6a3d6f09bb46a9b1e75dcef06bc24b591fcdc7b0
xen: Fix x86 sched_clock() interface for xen

Commit 34953c1129a4ca ("sched/clock, x86/tsc: Rework the x86 'unstable'
sched_clock() interface") broke Xen guest time handling across
migration:

[  187.249951] Freezing user space processes ... (elapsed 0.001 seconds) done.
[  187.251137] OOM killer disabled.
[  187.251137] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
[  187.252299] suspending xenstore...
[  187.266987] xen:grant_table: Grant tables using version 1 layout
[18446743811.706476] OOM killer enabled.
[18446743811.706478] Restarting tasks ... done.
[18446743811.720505] Setting capacity to 16777216

Fix that by setting xen_sched_clock_offset at resume time to ensure a
monotonic clock value.

[boris: replaced pr_info() with pr_info_once() in xen_callback_vector()
 to avoid printing with incorrect timestamp during resume (as we
 haven't re-adjusted the clock yet)]

Fixes: 34953c1129a4ca ("sched/clock, x86/tsc: Rework the x86 'unstable' sched_clock() interface")
Cc: <stable@vger.kernel.org> # 4.11
Reported-by: Hans van Kranenburg <hans.van.kranenburg@mendix.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Tested-by: Hans van Kranenburg <hans.van.kranenburg@mendix.com>
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
arch/x86/xen/time.c
drivers/xen/events/events_base.c