Messages in this thread Patch in this message |  | | Date | Sat, 6 Oct 2001 21:05:55 +0200 (CEST) | From | Mikulas Patocka <> | Subject | Re: %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; } |  |