lkml.org 
[lkml]   [2020]   [Mar]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH v1 01/11] perf/x86/core: Support KVM to assign a dedicated counter for guest PEBS
    From
    Date


    On 3/9/2020 11:05 AM, Peter Zijlstra wrote:
    >> In the new proposal, KVM user is treated the same as other host events with
    >> event constraint. The scheduler is free to choose whether or not to assign a
    >> counter for it.
    > That's what it does, I understand that. I'm saying that that is creating
    > artificial contention.
    >
    >
    > Why is this needed anyway? Can't we force the guest to flush and then
    > move it over to a new counter?

    KVM only traps the MSR access. There is no MSR access during the
    scheduling in guest.
    KVM/host only knows the request counter, when guest tries to enable the
    counter. It's too late for guest to start over.

    Regarding to the artificial contention, as my understanding, it should
    rarely happen in practical.
    Cloud vendors have to explicitly set pebs option in qemu to enable PEBS
    support for guest. They knows the environment well. They can avoid the
    contention. (We may implement some patches for qemu/KVM later to
    temporarily disable PEBS in runtime if they require.)

    For now, I think we may print a warning when both host and guest require
    the same counter. Host can get a clue from the warning.

    Thanks,
    Kan

    \
     
     \ /
      Last update: 2020-03-09 20:29    [W:8.242 / U:0.020 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site