lkml.org 
[lkml]   [2004]   [May]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 2.6.6-rc3-mm2 (4KSTACK)
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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:03    [W:0.077 / U:0.460 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site