public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* Re: WARNING: at arch/x86/kernel/kvmclock.c:127
@ 2012-06-10 15:47 Sedat Dilek
  2012-06-10 16:08 ` Sedat Dilek
  2012-06-11 21:47 ` Eric B Munson
  0 siblings, 2 replies; 12+ messages in thread
From: Sedat Dilek @ 2012-06-10 15:47 UTC (permalink / raw)
  To: Eric B Munson
  Cc: kvm, LKML, Avi Kivity, Marcelo Tosatti, Glauber Costa,
	Thomas Gleixner, Ingo Molnar, x86

Hi,

I see the same warning especially when resuming from a suspend (see
timestamps >=30-35sec) between Linux v3.5-rc1..v3.5-rc2.

$ sudo grep kvmclock.c /var/log/kern.log
Jun  4 21:11:32 fambox kernel: [  784.037237] WARNING: at
arch/x86/kernel/kvmclock.c:127
kvm_check_and_clear_guest_paused+0x52/0x60()
Jun  5 20:35:57 fambox kernel: [ 1928.458060] WARNING: at
arch/x86/kernel/kvmclock.c:127
kvm_check_and_clear_guest_paused+0x52/0x60()
Jun  8 09:35:52 fambox kernel: [ 3290.134637] WARNING: at
arch/x86/kernel/kvmclock.c:127
kvm_check_and_clear_guest_paused+0x52/0x60()
Jun  8 09:35:52 fambox kernel: [ 3290.238592] WARNING: at
arch/x86/kernel/kvmclock.c:127
kvm_check_and_clear_guest_paused+0x52/0x60()
Jun  8 12:11:20 fambox kernel: [ 5777.023571] WARNING: at
arch/x86/kernel/kvmclock.c:127
kvm_check_and_clear_guest_paused+0x52/0x60()
Jun  9 13:32:50 fambox kernel: [ 2778.842695] WARNING: at
arch/x86/kernel/kvmclock.c:127
kvm_check_and_clear_guest_paused+0x52/0x60()

>From [1]:

"...The warning itself is not required for the check_and_clear
function and can be removed as far as I am concerned."

>From [2] commit 3b5d56b9317fa7b5407dff1aa7b115bf6cdbd494 ("kvmclock:
Add functions to check if the host has stopped the vm")
...
+bool kvm_check_and_clear_guest_paused(void)
+{
+       bool ret = false;
+       struct pvclock_vcpu_time_info *src;
+
+       /*
+        * per_cpu() is safe here because this function is only called from
+        * timer functions where preemption is already disabled.
+        */
+       WARN_ON(!in_atomic());
+       src = &__get_cpu_var(hv_clock);
+       if ((src->flags & PVCLOCK_GUEST_STOPPED) != 0) {
+               __this_cpu_and(hv_clock.flags, ~PVCLOCK_GUEST_STOPPED);
+               ret = true;
+       }
+
+       return ret;
+}
+EXPORT_SYMBOL_GPL(kvm_check_and_clear_guest_paused);
+
...
( The export macro was dropped in a followup commit. )

So you mean "WARN_ON(!in_atomic());" can be deleted?

Regards,
- Sedat -

[1] http://www.spinics.net/lists/kvm/msg73732.html
[2] http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blobdiff;f=arch/x86/kernel/kvmclock.c;h=4ba090ca689db5322fb242b98b53158de5447dc9;hp=f8492da65bfcb03e2775638ad5ce9502099d62c8;hb=3b5d56b9317fa7b5407dff1aa7b115bf6cdbd494;hpb=eae3ee7d8a7c59cf63441dedf28674889f5fc477

^ permalink raw reply	[flat|nested] 12+ messages in thread
* WARNING: at arch/x86/kernel/kvmclock.c:127
@ 2012-06-05 18:20 Frank Arnold
  2012-06-06 15:52 ` Eric B Munson
  0 siblings, 1 reply; 12+ messages in thread
From: Frank Arnold @ 2012-06-05 18:20 UTC (permalink / raw)
  To: emunson; +Cc: avi, mtosatti, tglx, mingo, hpa, Joerg Roedel, kvm

Hi all,

I observed the following warning during testing of 3.5-rc1, involving
some intensive and random CPU online state toggling through sysfs. It
only shows up about 1 out of 500 times. Also, there was no KVM guest
running on the system.

------------[ cut here ]------------
WARNING: at arch/x86/kernel/kvmclock.c:127
kvm_check_and_clear_guest_paused+0x52/0x60()
Hardware name: Dinar
Modules linked in: nfs lockd fscache auth_rpcgss nfs_acl sunrpc ipv6
ext4 jbd2 dm_mod powernow_k8 freq_table mperf kvm_amd kvm crc32c_intel
ghash_clmulni_intel aesni_intel cryptd aes_x86_64 aes_generic microcode
serio_raw pcspkr k10temp amd64_edac_mod edac_core edac_mce_amd i2c_piix4
sg bnx2 ext3 jbd mbcache sr_mod cdrom sd_mod crc_t10dif ata_generic
pata_acpi pata_atiixp ahci libahci usb_storage radeon ttm drm_kms_helper
drm i2c_algo_bit i2c_core [last unloaded: scsi_wait_scan]
Pid: 3593, comm: py_topology Not tainted 3.5.0-rc1+ #1
Call Trace:
 [<ffffffff8104fd7f>] warn_slowpath_common+0x7f/0xc0
 [<ffffffff8104fdda>] warn_slowpath_null+0x1a/0x20
 [<ffffffff8103f252>] kvm_check_and_clear_guest_paused+0x52/0x60
 [<ffffffff810d29f7>] watchdog_timer_fn+0x97/0x1b0
 [<ffffffff81077743>] __run_hrtimer+0x83/0x1d0
 [<ffffffff810d2960>] ? touch_softlockup_watchdog_sync+0x40/0x40
 [<ffffffff81077b26>] hrtimer_interrupt+0x106/0x240
 [<ffffffff81077d98>] migrate_hrtimers+0x138/0x1a0
 [<ffffffff8150eb76>] hrtimer_cpu_notify+0xe4/0xeb
 [<ffffffff8151a655>] notifier_call_chain+0x55/0x80
 [<ffffffff8107961e>] __raw_notifier_call_chain+0xe/0x10
 [<ffffffff81052e50>] __cpu_notify+0x20/0x40
 [<ffffffff81052e85>] cpu_notify_nofail+0x15/0x30
 [<ffffffff814fc6bd>] _cpu_down+0x12d/0x270
 [<ffffffff814fc836>] cpu_down+0x36/0x50
 [<ffffffff814feeb4>] store_online+0x74/0xd0
 [<ffffffff8133e8a0>] dev_attr_store+0x20/0x30
 [<ffffffff811e0d5f>] sysfs_write_file+0xef/0x170
 [<ffffffff81171708>] vfs_write+0xc8/0x190
 [<ffffffff811718d1>] sys_write+0x51/0x90
 [<ffffffff8151eba9>] system_call_fastpath+0x16/0x1b
---[ end trace 574db9e069f4f35e ]---

This is a regression introduced by the following commit:

commit 3b5d56b9317fa7b5407dff1aa7b115bf6cdbd494
Author: Eric B Munson <emunson@mgebm.net>
Date:   Sat Mar 10 14:37:26 2012 -0500

    kvmclock: Add functions to check if the host has stopped the vm
    
    When a host stops or suspends a VM it will set a flag to show this.  The
    watchdog will use these functions to determine if a softlockup is real, or the
    result of a suspended VM.
    
    Signed-off-by: Eric B Munson <emunson@mgebm.net>
    asm-generic changes Acked-by: Arnd Bergmann <arnd@arndb.de>
    Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
    Signed-off-by: Avi Kivity <avi@redhat.com>


-- 
Regards,
Frank Arnold 

Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach
GM: Alberto Bozzo
Reg: Dornach, Landkreis Muenchen
HRB Nr. 43632 WEEE Registernr: 129 19551



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2012-06-15 11:08 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-10 15:47 WARNING: at arch/x86/kernel/kvmclock.c:127 Sedat Dilek
2012-06-10 16:08 ` Sedat Dilek
2012-06-11 21:47 ` Eric B Munson
2012-06-11 22:07   ` Marcelo Tosatti
2012-06-11 22:10     ` Eric B Munson
2012-06-12  2:13       ` Marcelo Tosatti
2012-06-12  8:48         ` Sedat Dilek
2012-06-15  9:35         ` Sedat Dilek
2012-06-15 11:08           ` Marcelo Tosatti
  -- strict thread matches above, loose matches on Subject: below --
2012-06-05 18:20 Frank Arnold
2012-06-06 15:52 ` Eric B Munson
2012-06-06 15:53   ` Eric B Munson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox