From: Ingo Molnar on

* Avi Kivity <avi(a)redhat.com> wrote:

> > I think you didnt understand my point. I am talking about 'perf kvm top'
> > hanging if Qemu hangs.
>
> Use non-blocking I/O, report that guest as dead. No point in profiling it,
> it isn't making any progress.

Erm, at what point do i decide that a guest is 'dead' versus 'just lagged due
to lots of IO' ?

Also, do you realize that you increase complexity (the use of non-blocking
IO), just to protect against something that wouldnt happen if the right
solution was used in the first place?

> > With a proper in-kernel enumeration the kernel would always guarantee the
> > functionality, even if the vcpu does not make progress (i.e. it's "hung").
> >
> > With this implemented in Qemu we lose that kind of robustness guarantee.
>
> If qemu has a bug in the resource enumeration code, you can't profile one
> guest. If the kernel has a bug in the resource enumeration code, the system
> either panics or needs to be rebooted later.

This is really simple code, not rocket science. If there's a bug in it we'll
fix it. On the other hand a 500KLOC+ piece of Qemu code has lots of places to
hang, so that is a large cross section.

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Avi Kivity on
On 03/22/2010 10:35 PM, Ingo Molnar wrote:
>
>>> And your point is that such vcpus should be excluded from profiling just
>>> because they fall outside the Qemu/libvirt umbrella?
>>>
>>> That is a ridiculous position.
>>>
>>>
>> Non-guest vcpus will not be able to provide Linux-style symbols.
>>
> And why do you say that it makes no sense to profile them?
>

It makes sense to profile them, but you don't need to contact their
userspace tool for that.

> Also, why do you define 'guest vcpus' to be 'Qemu started guest vcpus'? If
> some other KVM using project (which you encouraged just a few mails ago)
> starts a vcpu we still want to be able to profile them.
>
>

Maybe it should provide a mechanism for libvirt to list it.

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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Ingo Molnar on

* Avi Kivity <avi(a)redhat.com> wrote:

> On 03/22/2010 09:27 PM, Ingo Molnar wrote:
> >
> >> If your position basically boils down to, we can't trust userspace
> >> and we can always trust the kernel, I want to eliminate any
> >> userspace path, then I can't really help you out.
> >
> > Why would you want to 'help me out'? I can tell a good solution from a bad
> > one just fine.
>
> You are basically making a kernel implementation a requirement, instead of
> something that follows from the requirement.

No, i'm not.

> > You should instead read the long list of disadvantages above, invert them
> > and list then as advantages for the kernel-based vcpu enumeration
> > solution, apply common sense and go admit to yourself that indeed in this
> > situation a kernel provided enumeration of vcpu contexts is the most
> > robust solution.
>
> Having qemu enumerate guests one way or another is not a good idea IMO since
> it is focused on one guest and doesn't have a system-wide entity. A
> userspace system-wide entity will work just as well as kernel
> implementation, without its disadvantages.

A system-wide user-space entity only solves one problem out of the 4 i listed,
still leaving the other 3:

- Those special files can get corrupted, mis-setup, get out of sync, or can
be hard to discover.

- Apps might start KVM vcpu instances without adhering to the
system-wide access method.

- There is no guarantee for the system-wide process to reply to a request -
while the kernel can always guarantee an enumeration result. I dont want
'perf kvm' to hang or misbehave just because the system-wide entity has
hung.

Really, i think i have to give up and not try to convince you guys about this
anymore - i dont think you are arguing constructively anymore and i dont want
yet another pointless flamewar about this.

Please consider 'perf kvm' scrapped indefinitely, due to lack of robust KVM
instrumentation features: due to lack of robust+universal vcpu/guest
enumeration and due to lack of robust+universal symbol access on the KVM side.
It was a really promising feature IMO and i invested two days of arguments
into it trying to find a workable solution, but it was not to be.

Thanks,

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Avi Kivity on
On 03/22/2010 10:32 PM, Ingo Molnar wrote:
> * Anthony Liguori<anthony(a)codemonkey.ws> wrote:
>
>
>> On 03/22/2010 02:22 PM, Ingo Molnar wrote:
>>
>>>> Transitive had a product that was using a KVM context to run their
>>>> binary translator which allowed them full access to the host
>>>> processes virtual address space range. In this case, there is no
>>>> kernel and there are no devices.
>>>>
>>> And your point is that such vcpus should be excluded from profiling just
>>> because they fall outside the Qemu/libvirt umbrella?
>>>
>> You don't instrument it the way you'd instrument an operating system so no,
>> you don't want it to show up in perf kvm top.
>>
> Erm, why not? It's executing a virtualized CPU, so sure it makes sense to
> allow the profiling of it!
>

It may not make sense to have symbol tables for it, for example it isn't
generated from source code but from binary code for another architecture.

Of course, just showing addresses is fine, but you don't need qemu for that.

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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Avi Kivity on
On 03/22/2010 10:46 PM, Ingo Molnar wrote:
>
>>> You should instead read the long list of disadvantages above, invert them
>>> and list then as advantages for the kernel-based vcpu enumeration
>>> solution, apply common sense and go admit to yourself that indeed in this
>>> situation a kernel provided enumeration of vcpu contexts is the most
>>> robust solution.
>>>
>> Having qemu enumerate guests one way or another is not a good idea IMO since
>> it is focused on one guest and doesn't have a system-wide entity. A
>> userspace system-wide entity will work just as well as kernel
>> implementation, without its disadvantages.
>>
> A system-wide user-space entity only solves one problem out of the 4 i listed,
> still leaving the other 3:
>
> - Those special files can get corrupted, mis-setup, get out of sync, or can
> be hard to discover.
>

That's a hard requirement anyway. If it happens, we get massive data
loss. Way more troubling than 'perf kvm top' doesn't work. So consider
it fulfilled.

> - Apps might start KVM vcpu instances without adhering to the
> system-wide access method.
>

Then you don't get their symbol tables. That happens anyway if the
symbol server is not installed, not running, handing out fake data. So
we have to deal with that anyway.

> - There is no guarantee for the system-wide process to reply to a request -
> while the kernel can always guarantee an enumeration result. I dont want
> 'perf kvm' to hang or misbehave just because the system-wide entity has
> hung.
>

When you press a key there is no guarantee no component along the way
will time out.

> Really, i think i have to give up and not try to convince you guys about this
> anymore - i dont think you are arguing constructively anymore and i dont want
> yet another pointless flamewar about this.
>
> Please consider 'perf kvm' scrapped indefinitely, due to lack of robust KVM
> instrumentation features: due to lack of robust+universal vcpu/guest
> enumeration and due to lack of robust+universal symbol access on the KVM side.
> It was a really promising feature IMO and i invested two days of arguments
> into it trying to find a workable solution, but it was not to be.
>

I am not going to push libvirt or a subset thereof into the kernel for
'perf kvm'.

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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/