lkml.org 
[lkml]   [2009]   [Jan]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -v2] use per cpu data for single cpu ipi calls


On Thu, 29 Jan 2009, Peter Zijlstra wrote:
>
> Calls with wait=1 are deadlockable when done from within irqs or irq
> disabled sections because two cpus could cross ipi each other and stay
> waiting.

Sure. But this isn't the "wait=1" case. In the waiting case, we don't need
to allocate anything at all, we can just use the stack.

So the only case that matters for interrupts is indeed "wait=0", but
that's very much also the case we're talking about.

> That leaves us with the !wait case, which wasn't safe because that
> kmalloc could fail, and the fallback was wait, which yields the same
> deadlock.

Yes. I agree that the _concept_ of the patch is good. No argument there.

I'm just worried about the details.

> That leaves us with 6 cases,
>
> root@laptop:/usr/src/linux-2.6# git grep "smp_call_function_single(.*0)"

This misses a _lot_ of cases. What about this one:

kernel/relay.c: err = smp_call_function_single(i,

where you're not seeing if it's a non-waiting one or not (it's a waiting
one, but my point is that your grep is missing cases).

Doing

git grep -w smp_call_function_single | grep -v '1);'

is probably more likely to find the cases to look for.

But you're right, I'm still not seeing anything that looks _likely_ to be
a problem. But I worry that it's something somebody may want to do.

Linus


\
 
 \ /
  Last update: 2009-01-29 19:43    [W:0.194 / U:0.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site