Linux-Next Archive on lore.kernel.org
 help / color / Atom feed
From: Wanpeng Li <wanpeng.li@hotmail.com>
To: Stephen Rothwell <sfr@canb.auug.org.au>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	Gleb Natapov <gleb@kernel.org>
Cc: linux-next@vger.kernel.org, linux-kernel@vger.kernel.org,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: linux-next: build failure after merge of the kvm tree
Date: Tue, 8 Sep 2015 10:10:13 +0800
Message-ID: <BLU436-SMTP381CF188008388F4CA601D80530@phx.gbl> (raw)
In-Reply-To: <20150908113544.41d5a451@canb.auug.org.au>


[-- Attachment #1: Type: text/plain, Size: 1093 bytes --]

Hi Paolo, Stephen,
On 9/8/15 9:35 AM, Stephen Rothwell wrote:
> Hi all,
>
> After merging the kvm tree, today's linux-next build (powerpc
> ppc64_defconfig) failed like this:
>
> arch/powerpc/kvm/../../../virt/kvm/kvm_main.c: In function 'grow_halt_poll_ns':
> arch/powerpc/kvm/../../../virt/kvm/kvm_main.c:1931:2: error: implicit declaration of function 'trace_kvm_halt_poll_ns_grow' [-Werror=implicit-function-declaration]
>    trace_kvm_halt_poll_ns_grow(vcpu->vcpu_id, val, old);
>    ^
> arch/powerpc/kvm/../../../virt/kvm/kvm_main.c: In function 'shrink_halt_poll_ns':
> arch/powerpc/kvm/../../../virt/kvm/kvm_main.c:1945:2: error: implicit declaration of function 'trace_kvm_halt_poll_ns_shrink' [-Werror=implicit-function-declaration]
>    trace_kvm_halt_poll_ns_shrink(vcpu->vcpu_id, val, old);
>    ^
>
> Caused by commit
>
>    2cbd78244fb2 ("KVM: trace kvm_halt_poll_ns grow/shrink")
>
> I have reverted that commit for today.

I miss place the trace codes under CONFIG_KVM_ASYNC_PF, the patch in the 
attachment rewrite the commit and fix it. Sorry for that.

Regards,
Wanpeng Li

[-- Attachment #2: 0001-KVM-trace-kvm_halt_poll_ns-grow-shrink.patch --]
[-- Type: text/plain, Size: 2578 bytes --]

>From c06ca8fec43a7ccc1fe265afe8b2fd3b84085368 Mon Sep 17 00:00:00 2001
From: Wanpeng Li <wanpeng.li@hotmail.com>
Date: Tue, 8 Sep 2015 10:03:38 +0800
Subject: [PATCH] KVM: trace kvm_halt_poll_ns grow/shrink

Tracepoint for dynamic halt_pool_ns, fired on every potential change.

Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
---
 include/trace/events/kvm.h | 30 ++++++++++++++++++++++++++++++
 virt/kvm/kvm_main.c        |  8 ++++++--
 2 files changed, 36 insertions(+), 2 deletions(-)

diff --git a/include/trace/events/kvm.h b/include/trace/events/kvm.h
index a44062d..d6f8322 100644
--- a/include/trace/events/kvm.h
+++ b/include/trace/events/kvm.h
@@ -358,6 +358,36 @@ TRACE_EVENT(
 
 #endif
 
+TRACE_EVENT(kvm_halt_poll_ns,
+	TP_PROTO(bool grow, unsigned int vcpu_id, int new, int old),
+	TP_ARGS(grow, vcpu_id, new, old),
+
+	TP_STRUCT__entry(
+		__field(bool, grow)
+		__field(unsigned int, vcpu_id)
+		__field(int, new)
+		__field(int, old)
+	),
+
+	TP_fast_assign(
+		__entry->grow           = grow;
+		__entry->vcpu_id        = vcpu_id;
+		__entry->new            = new;
+		__entry->old            = old;
+	),
+
+	TP_printk("vcpu %u: halt_poll_ns %d (%s %d)",
+			__entry->vcpu_id,
+			__entry->new,
+			__entry->grow ? "grow" : "shrink",
+			__entry->old)
+);
+
+#define trace_kvm_halt_poll_ns_grow(vcpu_id, new, old) \
+	trace_kvm_halt_poll_ns(true, vcpu_id, new, old)
+#define trace_kvm_halt_poll_ns_shrink(vcpu_id, new, old) \
+	trace_kvm_halt_poll_ns(false, vcpu_id, new, old)
+
 #endif /* _TRACE_KVM_MAIN_H */
 
 /* This part must be outside protection */
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 8ab49cf..4662a88 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -1918,8 +1918,9 @@ EXPORT_SYMBOL_GPL(kvm_vcpu_mark_page_dirty);
 
 static void grow_halt_poll_ns(struct kvm_vcpu *vcpu)
 {
-	int val = vcpu->halt_poll_ns;
+	int old, val;
 
+	old = val = vcpu->halt_poll_ns;
 	/* 10us base */
 	if (val == 0 && halt_poll_ns_grow)
 		val = 10000;
@@ -1927,18 +1928,21 @@ static void grow_halt_poll_ns(struct kvm_vcpu *vcpu)
 		val *= halt_poll_ns_grow;
 
 	vcpu->halt_poll_ns = val;
+	trace_kvm_halt_poll_ns_grow(vcpu->vcpu_id, val, old);
 }
 
 static void shrink_halt_poll_ns(struct kvm_vcpu *vcpu)
 {
-	int val = vcpu->halt_poll_ns;
+	int old, val;
 
+	old = val = vcpu->halt_poll_ns;
 	if (halt_poll_ns_shrink == 0)
 		val = 0;
 	else
 		val /= halt_poll_ns_shrink;
 
 	vcpu->halt_poll_ns = val;
+	trace_kvm_halt_poll_ns_shrink(vcpu->vcpu_id, val, old);
 }
 
 static int kvm_vcpu_check_block(struct kvm_vcpu *vcpu)
-- 
1.9.1


  reply index

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-08  1:35 Stephen Rothwell
2015-09-08  2:10 ` Wanpeng Li [this message]
2015-09-08  9:24   ` Paolo Bonzini
  -- strict thread matches above, loose matches on Subject: below --
2020-07-17  5:57 Stephen Rothwell
2020-07-29  7:06 ` Stephen Rothwell
2020-05-21  6:28 Stephen Rothwell
2020-06-04  2:54 ` Stephen Rothwell
2019-02-18  3:42 Stephen Rothwell
2019-02-19 15:36 ` Sean Christopherson
2019-02-19 18:17   ` Paolo Bonzini
2018-12-19  4:33 Stephen Rothwell
2017-02-08  3:23 Stephen Rothwell
2016-12-19  1:11 Stephen Rothwell
2015-05-29  7:36 Stephen Rothwell
2015-05-29  7:54 ` Ingo Molnar
2015-05-29 12:08 ` Paolo Bonzini
2014-11-24  6:19 Stephen Rothwell
2014-11-24  9:38 ` Paolo Bonzini
2014-08-06  4:39 Stephen Rothwell
2014-03-11 23:55 Mark Brown
2014-01-10  3:00 Stephen Rothwell
2014-01-17  4:03 ` Stephen Rothwell
2012-08-23  3:21 Stephen Rothwell
2012-03-06  4:53 Stephen Rothwell
2012-03-06 10:34 ` Avi Kivity
2010-08-30  1:35 Stephen Rothwell
2010-08-30 10:03 ` Alexander Graf
2010-08-30 10:56   ` Avi Kivity

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=BLU436-SMTP381CF188008388F4CA601D80530@phx.gbl \
    --to=wanpeng.li@hotmail.com \
    --cc=gleb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=sfr@canb.auug.org.au \
    /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

Linux-Next Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-next/0 linux-next/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-next linux-next/ https://lore.kernel.org/linux-next \
		linux-next@vger.kernel.org
	public-inbox-index linux-next

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-next


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git