Re: 2.6.6-rc3-mm2 (4KSTACK)

Steve Lord
2004-05-07T16:17:07Z

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