All of lore.kernel.org
 help / color / mirror / Atom feed
From: William Cohen <wcohen@redhat.com>
To: "Santos, Jose Renato G (Jose Renato Santos)" <joserenato.santos@hp.com>
Cc: Ian Pratt <m+Ian.Pratt@cl.cam.ac.uk>,
	Aravind Menon <aravind.menon@epfl.ch>,
	xen-devel@lists.xensource.com,
	G John Janakiraman <john@arivalai.hpl.hp.com>,
	"Turner, Yoshio" <yoshio_turner@hp.com>
Subject: Re: Proposal for Xen support of performance monitoringanddebug hardware
Date: Mon, 25 Apr 2005 11:17:55 -0400	[thread overview]
Message-ID: <426D0A23.6010901@redhat.com> (raw)
In-Reply-To: <6C21311CEE34E049B74CC0EF339464B902FB78@cacexc12.americas.cpqcorp.net>

Santos,

Thanks for the comments. I will take a closer look at the Xen oprofile 
support and see what I can incoporate into the proposal.

Santos, Jose Renato G (Jose Renato Santos) wrote:
> 
>   William,
> 
>   Please, see my comments embedded in the text below.

[...]


>   I agree with Ian comments in his reply to this same email.
>   While Xenoprof is useful for providing system wide profiling, I can
>   see it would be usefull to have virtualization of MSR's and enable
>   domains to have individual hardware performance monitoring
> capabilities.
>   We were also thinking on these lines and planning to
>   extend xenoprof to have MSR virtualization.
> 
>   I did not understand how your global scope for MSR access would work.
>   It seems you were planning to provide system wide profiling with this.
>   (Please, clarify if this is not the case). I see the folowing
>   problems with this approach if I understood it correctly (from 
>   an Oprofile point of view):

The system-wide profiling was a relatively new addition to the document 
and it does need some more thought on how all the pieces work.

I was thinking that the xen_msr_allocate function would provide some 
information on how to route the performance monitoring hardware. Select 
scope as GLOBAL for domain 0 to reserve the performance monitoring 
hardware for domain 0. The xen_msr_irq_hander sets the irq for 
performance monitoring to route all perf irq to the domain that reserved 
the perf HW.


>   1) It would not be possible to profile hypervisor code, since
> interrupts 
>      caused by hardware overflow would be handled by the domain. When
>      the domain start executing the information about what Xen code was
>      running at the time of MSR overflow is lost. In Xenoprof we
>      handle the MSR interrupts inside the hypervisor and save
>      the PC value at that time, enabling the profile of
>      hypervisor code. An additional complication is the use of normal
>      IRQs instead of NMI. This would prevent performance profiling
>      of some parts of the kernel (including interrupt handlers).

Shouldn't it be possible for the hypervisor to send the needed 
information about address to the irq handler in the domain? From the 
address it should be possible to determine that it is a sample from the 
hypervisor. The overhead of moving things from hypervisor to domain 
might be undesirable.

I have some reservations about using NMI in this case. With OProfile it 
is quite possible to kill the machine by setting a sampling interval to 
be smaller than the overhead incurred by the interrupt servicing 
routine. Allowing NMIs would be a way for a domain to crash the entire 
machine. The NMI do allow better coverage of code.


>   2) It seems you plan to have interrupts that occurs in other
>      domains to be delivered to the owner of the MSR. A potential
>      problem with this approach is that this could cause additional
>      domain context swiching (to schedule the owner domain to 
>      handle the interrupt) and this could change your profiling
>      results. In addition, it is not clear how the interrupt
>      handler would get information about the PC sample at the
>      time of MSR overflow. Even if it was possible to receive this
>      information from the hypervisor, we would still need a way
>      to map this PC value to the right process and associated
>      binary file running on the other domain, which seems difficult.

PC values are pretty transient. Memory maps go away. The mapping the pc 
values to something reasonable is still an issue; there is a FIXME in 
the document for this. OProfile has some help in the kernel to convert 
the raw pc value to a dcookie and file offset. This help is not 
available to outside the domain.

>   I think both system wide profiling and single domain (virtualized)
>   profiling are important and it would be nice to have both.
>   As Ian mentioned we cannot have both at the same time,
>   at least for the same MSR. However, it would be possible to have
>   some registers being virtualized and others being used 
>   for system wide profiling, at the same time.
>   It would be nice to have a unified framework that could provide
>   both functionalities and a way to select.
> 
>   Renato 

Slicing and dicing the performance monitoring hardware may be possible, 
but it is a complicated operation. There are lots of constraints about 
the combinations that are allow and not allowed. Combinations like 
inter-domain and intra-domain sampling would be difficult because the 
interrupt would be the same. The allocation software would have to have 
a picture of all the domain allocations. There are lots of constraints 
on which registers can be used for what on pentium 4 and ppc64.

For the time being the proposal will address both global and virtual 
modes but not allow concurrent use of the global and virtual modes.

-Will

  reply	other threads:[~2005-04-25 15:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-23  2:27 Proposal for Xen support of performance monitoringanddebug hardware Santos, Jose Renato G (Jose Renato Santos)
2005-04-25 15:17 ` William Cohen [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-04-25 21:21 Santos, Jose Renato G (Jose Renato Santos)

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=426D0A23.6010901@redhat.com \
    --to=wcohen@redhat.com \
    --cc=aravind.menon@epfl.ch \
    --cc=john@arivalai.hpl.hp.com \
    --cc=joserenato.santos@hp.com \
    --cc=m+Ian.Pratt@cl.cam.ac.uk \
    --cc=xen-devel@lists.xensource.com \
    --cc=yoshio_turner@hp.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.