From: Eric B Munson <emunson@mgebm.net>
To: <sedat.dilek@gmail.com>
Cc: <kvm@vger.kernel.org>, LKML <linux-kernel@vger.kernel.org>,
Avi Kivity <avi@redhat.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
Glauber Costa <glommer@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@elte.hu>,
<x86@kernel.org>
Subject: Re: WARNING: at arch/x86/kernel/kvmclock.c:127
Date: Mon, 11 Jun 2012 17:47:00 -0400 [thread overview]
Message-ID: <0669740d6e2f3648f1c5c9a50e72f6eb@mgebm.net> (raw)
In-Reply-To: <CA+icZUUD+oHPK=L6iHg-FfkpXVCPQTKHuzwDo9EaYYjYmYePCA@mail.gmail.com>
On Sun, 10 Jun 2012 17:47:24 +0200, Sedat Dilek wrote:
> 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?
When I wrote the patch originally, I was under the (incorrect)
assumption that the watch dog was only ever reset in an atomic context.
Given that this is not the case, the warning can be removed. Though
before that happens, I have a question: if this is called outside of an
atomic context, is the use of __get_cpu_Var() and __this_cpu_and()
invalid?
Thanks,
Eric
next prev parent reply other threads:[~2012-06-11 22:09 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-10 15:47 Sedat Dilek
2012-06-10 16:08 ` Sedat Dilek
2012-06-11 21:47 ` Eric B Munson [this message]
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
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=0669740d6e2f3648f1c5c9a50e72f6eb@mgebm.net \
--to=emunson@mgebm.net \
--cc=avi@redhat.com \
--cc=glommer@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mtosatti@redhat.com \
--cc=sedat.dilek@gmail.com \
--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
all inboxes | Powered by JetHome®