1. Create a swap partition > 128GB 2. Run mkswap on the partition 3. Run swapon with that partition strace shows: swapon("/dev/cciss/c0d0p1") = -1 ENOMEM (Cannot allocate memory) kernel-2.6.9-34.EL
Can you retry this with the latest RHEL4 kernel? I added a patch to "make vmalloc() succeed for larger memory allocations" in kernel-2.6.9-34.4.EL ant that is why the swapon is failing. Larry Woodman
This BZ can be closed. The problem was that sys_swapon () called vmalloc() which failed due to kernel memory fragmentation, because it called kmalloc() for the page_array. I changed __vmalloc() to recursively call vmalloc() when the page_array is larger than 1 page and this no longer fails. Larry Woodman
Verified that this was fixed after kernel-2.6.9-34.EL ------------------------------------------------------------------------------- * Thu Mar 16 2006 Jason Baron <jbaron> [2.6.9-34.4] -make vmalloc() succeed for larger memory allocations (Larry Woodman) [173193] ------------------------------------------------------------------------------- @@ -429,7 +432,11 @@ void *__vmalloc(unsigned long size, int array_size = (nr_pages * sizeof(struct page *)); area->nr_pages = nr_pages; - area->pages = pages = kmalloc(array_size, (gfp_mask & ~__GFP_HIGHMEM)); + if (array_size > PAGE_SIZE) + pages = __vmalloc(array_size, gfp_mask, PAGE_KERNEL); + else + pages = kmalloc(array_size, (gfp_mask & ~__GFP_HIGHMEM)); + area->pages = pages; if (!area->pages) { remove_vm_area(area->addr); kfree(area); -------------------------------------------------------------------------------- Larry Woodman