Re: [PATCH -v2] x86: MCE: Re-implement MCE log ring buffer as per-CPU ring buffer

From: Andi Kleen
Date: Tue Apr 28 2009 - 06:22:29 EST


Huang Ying <ying.huang@xxxxxxxxx> writes:
>
> ChangeLog:
>
> v2:
>
> - Use alloc_percpu() to allocate per_cpu mcelog buffer

Sorry, why didn't you just use DEFINE_PER_CPU ? That should work
as well and will be shorter.

Another thing I noticed. the "MACHINECHECK" signature was originally
for crash dump tools to find the log. If you change the format
you should change it to MACHINECHEC2 or so.

> + size_t usize_limit;
> +
> + /* Too large user buffer size may cause system not response */
> + usize_limit = num_possible_cpus() * MCE_LOG_LEN * sizeof(struct mce);
> + if (usize > usize_limit)
> + usize = usize_limit;

Did you ever track down what happens here? I still find it worrying

Otherwise looks good.

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