Re: [PATCH] perf_events: AMD event scheduling (v2)

From: Stephane Eranian
Date: Thu Feb 04 2010 - 11:35:32 EST


>> What I'm worried about is:
>>
>> CPU A and B are of the same NorthBridge and all node counters are taken.
>>
>> CPU-A Â Â Â Â Â Â Â Â Â CPU-B
>>
>> perf_disable();
>> event->pmu->disable(event)
>> Âx86_pmu.put_event_constraint() /* free slot n */
>>
>> Â Â Â Â Â Â Â Â Â Â Â Âevent->pmu->enable(event);
>> Â Â Â Â Â Â Â Â Â Â Â Â Âx86_schedule_events();
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Âx86_pmu.get_event_constraint() /* grab slot n */
>>
>> event->pmu->enable(event)
>> Âx86_schedule_events()
>> Â Âx86_pmu.get_event_constraint() /* FAIL */
>> perf_enable();
>>
>> That means you cannot disable/enable the same event within a
>> perf_disable/enable section.
>>
> Yes but I would say that is because of the logic behind the enable/disable
> interface. Here you are disabling "for a short period", you know you're going
> to re-enable. Yet you are using an API that is a generic enable/disable.
> You would need to pass some argument to disable() to say "temporary"
> or "stop but don't release the resource".
>
I think if you were to distinguish between "stop the counter", and
"free the counter"
things would work better here.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/