Re: [PATCH] [1/4] x86: MCE: Make polling timer interval per CPU

From: Andi Kleen
Date: Wed Apr 08 2009 - 06:43:58 EST


Hidetoshi Seto <seto.hidetoshi@xxxxxxxxxxxxxx> writes:
>>
>> @@ -632,14 +633,14 @@
>> static void mce_init_timer(void)
>> {
>> struct timer_list *t = &__get_cpu_var(mce_timer);
>> + int *n = &__get_cpu_var(next_interval);
>>
>> - /* data race harmless because everyone sets to the same value */
>> - if (!next_interval)
>> - next_interval = check_interval * HZ;
>> - if (!next_interval)
>
> [plan A]
> Add
> if (!check_interval)
> return;
>
> Or...
>
>> + if (!*n)
>> + *n = check_interval * HZ;
>> + if (!*n)
>> return;


The !*n will return for check_interval == 0 because 0*HZ is still 0 so it should be
equivalent. Did I miss something?

-Andi


--
ak@xxxxxxxxxxxxxxx -- Speaking for myself only.
--
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/