Re: [PATCH] fix strange stack calculation for secondary cpus

From: Dave Hansen (
Date: Tue Dec 10 2002 - 20:23:15 EST

Hugh Dickins wrote:
> On Tue, 10 Dec 2002, Dave Hansen wrote:
>>in arch/i386/kernel/smpboot.c:
>>stack_start.esp = (void *) (1024 + PAGE_SIZE + (char *)idle);
>>This causes problems when I switch to 4k stacks? What is supposed to
>>be going on here? Why point esp into the middle of the stack? If you
>>wanted to do that, why not just use PAGE_SIZE>>2?
> To avoid mysterious magic numbers, I chose instead to start it immediately
> below that area i.e. set the top esp here to the bottom esp there. That
> worked fine for 2.4, I don't see why the same shouldn't work for 2.5.

It should. I just want to be able to use arbitrary stack sizes.

> Whereas with your patch, you might be overwriting that area.
> So below I've munged your patch into what we found worked back then.

Agreed. I was really just trying to eliminate the magic number
without much real knowledge about what was going on.

Would you like to send your patch on to Alan or Linus?

Dave Hansen

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to More majordomo info at Please read the FAQ at

This archive was generated by hypermail 2b29 : Sun Dec 15 2002 - 22:00:19 EST