From: Nadav Har'El <n...@scylladb.com>
Committer: Nadav Har'El <n...@scylladb.com>
Branch: master

boot.S: Increase main() stack size

We use "init_stack_top" as the end of the stack for loader.cc's premain()
and main() functions (all other threads will allocate their stacks
dynamically). A size of 4*4096 = 16384 bytes was reserved for this stack,
but we actually use more (main() puts a sched::thread object on the stack
and its size is currently 20880 bytes.

So this patch increase this boot stack size to 10*4096 = 40960 bytes.
Note that as currently written, this stack continues to take up space even
after boot, so we don't want it excessively big.

I'm not sure how this overflow didn't cause any serious problems. What we
have right before this stack is the percpu section, and it's quite possible
that when most parts of it (e.g., worker queues, trace buffers, etc.) are
overwritten in early boot nothing bad happens because nothing is using
these areas at that time. But it's certainly not a good reason to leave
this bug behind. Especially not when we know of bugs which one guess is
that they are caused by overwrite of the per-cpu area (see issue #382).

Signed-off-by: Nadav Har'El <n...@scylladb.com>
Message-Id: <20170712211813.18741-1-...@scylladb.com>

---
diff --git a/arch/x64/boot.S b/arch/x64/boot.S
--- a/arch/x64/boot.S
+++ b/arch/x64/boot.S
@@ -44,7 +44,7 @@ gdt_end = .
 .bss

 .align 16
-. = . + 4096*4
+. = . + 4096*10
 init_stack_top = .

 . = . + 4096*10

--
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to