lkml.org 
[lkml]   [2007]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [perfmon] Re: [perfmon2] perfmon2 merge news
    Andi.

    On Tue, Nov 13, 2007 at 10:29:02PM +0100, Andi Kleen wrote:
    > On Tue, Nov 13, 2007 at 01:13:45PM -0800, Stephane Eranian wrote:
    > > Oprofile does not setup the PMU interrupt. It builds on top of the NMI watchdog
    > > setup.
    >
    > Oprofile works without the NMI watchdog too, but it just happens to be another
    > NMI user.
    >
    I have no doubt it can work with a "regular" interrupt.

    > > It uses the register_die() mechanism,
    >
    > Not correct.
    >
    I meant the register_die_notifier() mechanism which allow you to
    chain a handler on NMI interrupts. At least that's my understanding
    reading the code:

    static int nmi_setup(void)
    {
    int err=0;
    int cpu;

    if (!allocate_msrs())
    return -ENOMEM;

    if ((err = register_die_notifier(&profile_exceptions_nb))){
    free_msrs();
    pfm_release_allcpus();
    return err;
    }
    ...


    > > if I recall. The low level APIC
    > > and gate is setup elsewhere. Perfmon does not use NMI, unless forced to because
    > > of the NMI watchdog.
    >
    > It could handle it in the same way as oprofile if it wanted. But given
    > NMIs make everything more complicated and it might not be worth it.
    >
    Yes, horribly more complicated because of locking issues within perfmon.
    As soon as you expose a file descriptor, you need some locking to prevent
    multiple user threads (malicious or not) to compete to access the PMU state.
    I think the value add of NMI can be as well achieved with advanced PMU features
    such as Intel Core 2 PEBS.

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

    \
     
     \ /
      Last update: 2007-11-13 22:52    [W:4.056 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site