anand kumar wrote: > We are developing a PCI driver for a specialized hardware which > needs blocks of physically contiguous memory regions of > 32 KB. We need to allocate 514 such blocks for a total of 16 MB > We were using an ioctl implementation in the driver which uses > kmalloc() to allocate the required memory blocks. > kmalloc()(GFP_KERNEL) > fails after allocating some 250 blocks of memory (probably due to > fragmentation). > We then tried using __get_free_pages() and the result was the > same. Well, kmalloc() falls back to __get_free_pages() eventually (after going through the slab cache), so it isn't much of a surprise that both failed. > Even though the free pages in zone NORMAL and DMA were 10000 and > 1500 respectively. Can you try this on a kernel that has /proc/buddyinfo? It exports the buddy allocators internal structures so that you can see the fragmentation. buddyinfo has been in 2.5 since ~2.5.35. There may even be a 2.4 version floating around... If you can post some code too, it might be helpful. -- Dave Hansen haveblue@us.ibm.com