* [im]proper use of stack?
@ 2006-10-19 16:23 mfbaustx
2006-10-19 22:22 ` Alan Cox
0 siblings, 1 reply; 2+ messages in thread
From: mfbaustx @ 2006-10-19 16:23 UTC (permalink / raw)
To: linux-kernel@vger.kernel.org
So... I know that there is some small-ish amount of kernel stack space
available per-process, and the kernel uses this area when executing on a
process's behalf (system call, etc). Let's say I allocate (via an
automatic/stack-based storage) some smallish structure which I want a
kernel thread to populate (or interrupt context... some context other than
my process's context).
If my process gets context swapped, is my kernel-based stack pointer
always valid?
Why use stack-based storage, you ask? Let's pretend this is a
high-frequency call and I don't want to incur the expense of kmalloc'ing
and freeing on every call. I know I have enough stack space, I just don't
know if my stack is always available :)
TIA!
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [im]proper use of stack?
2006-10-19 16:23 [im]proper use of stack? mfbaustx
@ 2006-10-19 22:22 ` Alan Cox
0 siblings, 0 replies; 2+ messages in thread
From: Alan Cox @ 2006-10-19 22:22 UTC (permalink / raw)
To: mfbaustx; +Cc: linux-kernel@vger.kernel.org
Ar Iau, 2006-10-19 am 11:23 -0500, ysgrifennodd mfbaustx:
> So... I know that there is some small-ish amount of kernel stack space
> available per-process, and the kernel uses this area when executing on a
> process's behalf (system call, etc). Let's say I allocate (via an
> automatic/stack-based storage) some smallish structure which I want a
> kernel thread to populate (or interrupt context... some context other than
> my process's context).
>
> If my process gets context swapped, is my kernel-based stack pointer
> always valid?
Have a look how the kernel sleep/wakeup system work. We rely on the
property that the kernel stacks of tasks don't move nor do they get
swapped out.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-10-19 22:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-19 16:23 [im]proper use of stack? mfbaustx
2006-10-19 22:22 ` Alan Cox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox