All of lore.kernel.org
 help / color / mirror / Atom feed
* profiling virtio (blk in this case)
@ 2009-05-14 16:09 Eran Rom
  2009-05-17 20:37 ` Avi Kivity
  0 siblings, 1 reply; 2+ messages in thread
From: Eran Rom @ 2009-05-14 16:09 UTC (permalink / raw)
  To: kvm

The "Host<-->Guest" calls in virtio_blk (using the generic virtio kick/notify)
are as follows:

Guest->Host
-----------
do_virtlkb_request calls kick in the guest side causing handle_output to be
called on the host side.

Host->Guest
-----------
virtio_blk_rw_complete calls notify in the host side causing block_done to be
called on the guest side

My question has to do with the timing of the calls.
Which would be the correct drawing
1. Overlapping:
kick             |------------|
handle_output             |------------|
2. Disjoint:
kick             |------------|
handle_output                    |------------|

In other words:
if I do
g1 = get_cpu_cycles
kick
g2 = get_cpu_cycles
and 
h1 = get_cpu_cycles
handle_output
h2 = get_cpu_cycles
would (g2-g1) + (h2-h2) count some cycles twice?

Same question for notify and block_done.

Thanks very much,
Eran



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

* Re: profiling virtio (blk in this case)
  2009-05-14 16:09 profiling virtio (blk in this case) Eran Rom
@ 2009-05-17 20:37 ` Avi Kivity
  0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2009-05-17 20:37 UTC (permalink / raw)
  To: Eran Rom; +Cc: kvm

Eran Rom wrote:
> The "Host<-->Guest" calls in virtio_blk (using the generic virtio kick/notify)
> are as follows:
>
> Guest->Host
> -----------
> do_virtlkb_request calls kick in the guest side causing handle_output to be
> called on the host side.
>
> Host->Guest
> -----------
> virtio_blk_rw_complete calls notify in the host side causing block_done to be
> called on the guest side
>
> My question has to do with the timing of the calls.
> Which would be the correct drawing
> 1. Overlapping:
> kick             |------------|
> handle_output             |------------|
> 2. Disjoint:
> kick             |------------|
> handle_output                    |------------|
>   

kick() competely contains handle_output().

> In other words:
> if I do
> g1 = get_cpu_cycles
> kick
> g2 = get_cpu_cycles
> and 
> h1 = get_cpu_cycles
> handle_output
> h2 = get_cpu_cycles
> would (g2-g1) + (h2-h2) count some cycles twice?
>   

h2-h1 would be counted twice.

> Same question for notify and block_done.
>   

Different answer.  The guest starts executing sometimes in the middle of 
the host notify function.

-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


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

end of thread, other threads:[~2009-05-17 20:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-14 16:09 profiling virtio (blk in this case) Eran Rom
2009-05-17 20:37 ` Avi Kivity

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.