lkml.org 
[lkml]   [2000]   [Dec]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: system call fails with ENOMEM after long operation
> So why is the kernel having difficulty allocating memory for its
> internal operations? We are suspecting memory fragmentation issues
> (at the application level which might have adverse sideefects for the
> kernel). Is it something that we can do so that the kernel will be
> able to allocate the needed memory for carrying out the system call?

Try this patch.

Mikulas

--- linux/mm/page_alloc.c__ Thu Mar 9 15:12:31 2000
+++ linux/mm/page_alloc.c Tue Mar 21 09:50:12 2000
@@ -237,6 +237,15 @@
RMQUEUE_TYPE(order, 1);
spin_unlock_irqrestore(&page_alloc_lock, flags);

+ if (!(current->flags & PF_MEMALLOC) && (gfp_mask & __GFP_WAIT)) {
+ int freed;
+ current->trashing_mem = 1;
+ current->flags |= PF_MEMALLOC;
+ freed = try_to_free_pages(gfp_mask);
+ current->flags &= ~PF_MEMALLOC;
+ if (freed) goto ok_to_allocate;
+ }
+
nopage:
return 0;
}

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

\
 
 \ /
  Last update: 2005-03-22 12:52    [W:0.029 / U:4.096 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site