Re: Buggy IPI and MTRR code on low memory

From: Peter Zijlstra
Date: Wed Jan 28 2009 - 12:01:29 EST


On Wed, 2009-01-28 at 11:56 -0500, Steven Rostedt wrote:
> On Wed, 28 Jan 2009, Peter Zijlstra wrote:
>
> > On Wed, 2009-01-28 at 11:38 -0500, Steven Rostedt wrote:
> >
> > > The problem is that if we use the stack, then we must wait for the
> > > function to finish. But in the mtrr code, the called functions are waiting
> > > for the caller to do something after the smp_call_function. Thus we
> > > deadlock!
> >
> > You'd have to 'fix' the regular fallback paths to use your scheme as
> > well.
>
> Not sure what you mean by that. I booted just fine with the patch, and
> forcing data to NULL. Although, I'm not saying that these should not be
> fixed.

Yeah, I was being confused by:

> @@ -230,6 +242,20 @@ int smp_call_function_single(int cpu, void (*func) (void *info), void *info,
> data = kmalloc(sizeof(*data), GFP_ATOMIC);
> if (data)
> data->flags = CSD_FLAG_ALLOC;
> + else {
> + /*
> + * There exist callers that call
> + * functions that will wait on the caller
> + * to do something after calling this.
> + * This means we can not wait for the callee
> + * function to finish.
> + * Use the stack data but have the callee
> + * copy it and tell us we can continue
> + * before they call the function.
> + */
> + data = &d;
> + data->flags = CSD_FLAG_RELEASE;
> + }
> }
> if (!data) {
> data = &d;

that second !data test in there, thinking there was a fallback path
still relying on CSD_FLAG_WAIT.

It appears all is well indeed.

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