lkml.org 
[lkml]   [2001]   [Oct]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: %u-order allocation failed
> This is enhanced version of a patch that fixes select and poll as well.
> Again - not compiled, not tried.

There is a bug that it does not align allocation - so things like
(%esp & ~8191) won't work. This should be applied on the top of it.

Mikulas
--- linux-orig/mm/vmalloc.c Sat Oct 6 16:21:47 2001
+++ linux/mm/vmalloc.c Sat Oct 6 21:01:00 2001
@@ -170,6 +170,9 @@
{
unsigned long addr;
struct vm_struct **p, *tmp, *area;
+ int align = 0;
+
+ if (size > PAGE_SIZE && !(size & (size - 1))) align = size - 1;

area = (struct vm_struct *) kmalloc(sizeof(*area), GFP_KERNEL);
if (!area)
@@ -183,6 +186,7 @@
if (size + addr <= (unsigned long) tmp->addr)
break;
addr = tmp->size + (unsigned long) tmp->addr;
+ addr = (addr + align) & ~align;
if (addr > VMALLOC_END-size)
goto out;
}
\
 
 \ /
  Last update: 2005-03-22 13:04    [W:0.077 / U:0.892 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site