Re: [PATCH 2/2] x86, mce: rework use of TIF_MCE_NOTIFY

Hidetoshi Seto
2011-06-15T01:30:29Z

(2011/06/15 3:28), Tony Luck wrote:
> On Tue, Jun 14, 2011 at 11:02 AM, Tony Luck <tony.luck@intel.com> wrote:
>> need (failing address) to take some action. That was put into
>> the ring
>
> Correction - we only put the pfn into the ring for AO (action optional)
> errors [in the current state of the patch series].
>
> But the need for a path to get the pfn from the MC handler to the
> mce_notify_process() function remains the same.

Are there any reason why we cannot have a small special buffer for AR?
For example:

# writer side:
for (i = 0; i < ar_buf_size; i++) {
if (!cmpxchg(&ar_buf[i].pid, 0, current->pid)) {
ar_buf[i].pfn = pfn;
return 0;
}
}
return -1; /* buffer full */

# reader side:
for (i = 0; i < ar_buf_size; i++) {
if (ar_buf[i].pid == current->pid) {
mce_handle_srar(ar_buf[i].pfn);
ar_buf[i].pid = 0;
}
}

I think it is not intrusive rather than having X-bytes for each thread,
which is usually 99.99% unused for its lifetime.

Or ... is it possible to push siginfo w/ addr and pop here?

Thanks,
H.Seto