Re: BUG-lockdep and freeze (was: Arrr! Linux 2.6.18)

From: Linus Torvalds
Date: Sat Sep 30 2006 - 18:54:58 EST




On Sat, 30 Sep 2006, Andi Kleen wrote:
>
> That wouldn't work with interrupt stacks.

Andi.

Please spend even just a few minutes looking at the old i386 code.

> The old unwinder code had a state machine to deal with them, but it was
> distingustingly complicated (there are nasty corner cases where you can
> be in multiple interrupt stacks nested). I'm not sure we would have
> really wanted to retain that.

Here's what the old code did:

frameptr = initialize frame code
while (1) {
struct thread_info *context;
context = (struct thread_info *)
((unsigned long)stack & (~(THREAD_SIZE - 1)));
frameptr = print_context_stack(context, stack, frameptr, log_lvl);
stack = (unsigned long*)context->previous_esp;
if (!stack)
break;
printk(" =======================\n");
}

it it really was that simple. The actual frame-following code was in
"print_context_stack()", and it works entirely within a single stack page,
and returns once it is outside that stack page.

There is absolutely ZERO problem with new pages through interrupt stacks
etc, because we don't even trust the stack contents for that, we just
follow the stack context pointers that we _can_ trust.

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