Re: [PATCH] perf, x86: Fix Intel shared extra MSR allocation

From: Yan, Zheng
Date: Tue Jun 05 2012 - 21:00:14 EST


On 06/05/2012 09:56 PM, Peter Zijlstra wrote:
>> @@ -1157,14 +1163,14 @@ __intel_shared_reg_get_constraints(struct cpu_hw_events *cpuc,
>> > struct event_constraint *c = &emptyconstraint;
>> > struct er_account *era;
>> > unsigned long flags;
>> > - int orig_idx = reg->idx;
>> > + int idx = reg->idx;
>> >
>> > /* already allocated shared msr */
>> > if (reg->alloc)
>> > return NULL; /* call x86_get_event_constraint() */
> I'm afraid that needs to be:
>
> /*
> * reg->alloc can be set due to existing state, so for fake cpuc
> * we need to ignore this, otherwise we might fail to allocate
> * proper fake state for this extra reg constraint. Also see
> * the comment below.
> */
> if (reg->alloc && !cpuc->is_fake)
> return NULL; /* call x86_get_event_constraints() */
>
Agree

Regards
Yan, Zheng



--
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/