Keep Stack usage to a minimum On i386 user context in kernel is 8k per process - sizeof(struct user) = 5136 bytes deeply nested and/or recursive code is asking for trouble "I was asked for general rules for stack allocation. Well, here it is: You will never, ever change a function in the kernel so that it allocates more than 256 bytes on the stack (and even that can be too much in some cases). And when all the offenders are fixed, I will start checking those that eat more than 100 bytes." - art@ The -Wstack-larger-than-N warning has been added to GCC in base to help prevent the existance of such code, currently the kernel is compiled with -Wstack-larger-than-2047. Use malloc(9) or global declarations in the data segment, not local variables for large arrays of data.