public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: Avi Kivity <avi@redhat.com>
Cc: Bharat Bhushan <r65777@freescale.com>,
	kvm@vger.kernel.org, bharatb.yadav@gmail.com,
	Bharat Bhushan <Bharat.Bhushan@freescale.com>
Subject: Re: [PATCH] KVM:PPC Issue in exit timing clearance
Date: Tue, 22 Mar 2011 15:27:07 +0100	[thread overview]
Message-ID: <4D88B1BB.8070306@suse.de> (raw)
In-Reply-To: <4D88998B.6050208@redhat.com>

On 03/22/2011 01:43 PM, Avi Kivity wrote:
> On 03/16/2011 06:37 PM, Bharat Bhushan wrote:
>> Following dump is observed on host when clearing the exit timing 
>> counters
>>
>> [root@p1021mds kvm]# echo -n 'c'>  vm1200_vcpu0_timing
>> INFO: task echo:1276 blocked for more than 120 seconds.
>> "echo 0>  /proc/sys/kernel/hung_task_timeout_secs" disables this 
>> message.
>> echo          D 0ff5bf94     0  1276   1190 0x00000000
>> Call Trace:
>> [c2157e40] [c0007908] __switch_to+0x9c/0xc4
>> [c2157e50] [c040293c] schedule+0x1b4/0x3bc
>> [c2157e90] [c04032dc] __mutex_lock_slowpath+0x74/0xc0
>> [c2157ec0] [c00369e4] kvmppc_init_timing_stats+0x20/0xb8
>> [c2157ed0] [c0036b00] kvmppc_exit_timing_write+0x84/0x98
>> [c2157ef0] [c00b9f90] vfs_write+0xc0/0x16c
>> [c2157f10] [c00ba284] sys_write+0x4c/0x90
>> [c2157f40] [c000e320] ret_from_syscall+0x0/0x3c
>>
>>     The vcpu->mutex is used by kvm_ioctl_* (KVM_RUN etc) and same was 
>> used when clearing the stats (in kvmppc_init_timing_stats()).
>> What happens is that when the guest is idle then it held the 
>> vcpu->mutx. While the exiting timing process waits for guest to 
>> release the vcpu->mutex and a hang state is reached.
>>
>>     Now using seprate lock for exit timing stats.
>>
>
> Seems excessive to have a new lock just for timing.

The whole thing is only used for debugging, so being excessive doesn't 
hurt too much here. In normal configurations, it's #ifdef'ed out.

>
> What about using vcpu->requests to have the statistics cleared in vcpu 
> context?
>
> What about dropping the whole thing and replacing it with tracepoints?

That should work. The question is if it's worth the effort. The current 
code is there after all :).


Alex


  reply	other threads:[~2011-03-22 14:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-16 16:37 [PATCH] KVM:PPC Issue in exit timing clearance Bharat Bhushan
2011-03-22 12:43 ` Avi Kivity
2011-03-22 14:27   ` Alexander Graf [this message]
2011-03-23  9:20     ` Avi Kivity
2011-03-24  2:21       ` Bhushan Bharat-R65777
2011-03-24 10:20         ` Avi Kivity
2011-03-25  4:50           ` Bhushan Bharat-R65777

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=4D88B1BB.8070306@suse.de \
    --to=agraf@suse.de \
    --cc=Bharat.Bhushan@freescale.com \
    --cc=avi@redhat.com \
    --cc=bharatb.yadav@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=r65777@freescale.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox