This is the sort of things that would severely limit our ability to
shrink the kernel stack. While it's perhaps feasible to shrink kernel
stack usage for typical syscalls, exactly the situation you describe is
unpredictable and very difficult to avoid.
My suggestion would be that if we do manage to get typical stack usage
down to the point where we can go to a 4K stack, then interrupt handlers
would have to be rewritten to recognize whether or not the interrupt
arrived on a user process kernel stack and then move the context over to
the "interrupt stack". The overhead would be low enough that it's worth
doing so that we could reduce process kernel stack size. Whenever an
interrupt service routine is itself interrupted, the interrupt stack
check code would realize that it is already using the interrupt stack
and not move the context. Here, then, we would need only one single
interrupt stack which we would size for worst case; so if we made it 8
or 12K, that's 8 or 12K once for each CPU which is allowed to receive
interrupts, not once per process.
You like? :)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/