Results 1 to 2 of 2
When a process is created by fork(), kernel calls do_fork().
do_fork() calls copy_process()
and a union thread_union is created in the kernel memory space.
union thread_union {
struct thread_info thread_info;
...
- 03-12-2009 #1Just Joined!
- Join Date
- Mar 2009
- Posts
- 2
Question about kernel stack
When a process is created by fork(), kernel calls do_fork().
do_fork() calls copy_process()
and a union thread_union is created in the kernel memory space.
union thread_union {
struct thread_info thread_info;
unsigned long stack[THREAD_SIZE/sizeof(long)];
}
Usually, on IA32 the size of thread_union is 8KB.
On some special machine architecture, the size is 4KB.
| 8K| kernel stack
| . . | |
| . . | V
| . . |------------------------
| . . |
| . . |-----------------------
| 0. | thread info
I wonder what kind of data will be put in the kernel stack. Since it only has a space of 8KB or 4KB, a rather small number, will there be a risk that the stack overflows?
- 03-12-2009 #2
The main purpose of the user's kernel stack is facilitate system calls which don't require a large stack...Gerard4143
Make mine Arch Linux


Reply With Quote
