Re: 2.6.6-rc3-mm2 (4KSTACK)

From: Steve Lord
Date: Fri May 07 2004 - 11:18:52 EST


Arjan van de Ven wrote:
On Fri, May 07, 2004 at 10:47:56AM -0500, Steve Lord wrote:

- if (mlen > sizeof(buf))
+ obj.data = kmalloc(1024, GFP_KERNEL);
+ if (!obj.data)
+ return -ENOMEM;
+
+ if (mlen > 1024) {

That's what I hate about all of this, just think how much stack that
kmalloc can take in low memory situations.... it might end up in
writepage on another nfs file....


it clearly needs to be GFP_NOFS

That was not really my point, consider any memory allocation on the
stack which is being replaced with an allocate to save space. Then replace
the saved stack space with the potential stack space used to
free memory by writing it out via a filesystem. You cannot make all
the allocations in the kernel GFP_NOFS.

Now at least if the memory is allocated high enough up in the
call chain it fixes the problems of a function with a large
stack frame with a deep stack underneath it. It does not fix
anything if the function is already deep in the stack.

All this is doing is papering over the cracks.

Steve


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/