An alternative to the buddy system would be to use the memory management unit (MMU) support to rewire or re-arrange blobs of free pages together to construct larger contiguous pages. However, this will not work for DMA systems which bypass the MMU. Also, modifying the virtual address on a continual basis would make the paging process slow.
Debugging on the buddy system can be done by printing the current stats. This is supported under the /proc/buddyinfo file. As described in the guide from centos.org, fragmentation issues can be debugged. A sample output from the same site is as shown below:
cat /proc/buddyinfo
Node 0, zone DMA 90 6 2 1 1 ... Node 0, zone Normal 1650 310 5 0 0 ... Node 0, zone HighMem 2 0 0 1 1 ...
Explanation from the website(1):
Hope this was useful.Each column represents the number of pages of a certain order (a certain size) that are available at any given time. For example, for zone DMA (direct memory access), there are 90 of 2^(0*PAGE_SIZE) chunks of memory. Similarly, there are 6 of 2^(1*PAGE_SIZE) chunks, and 2 of 2^(2*PAGE_SIZE) chunks of memory available.TheDMA
row references the first 16 MB on a system, theHighMem
row references all memory greater than 4 GB on a system, and theNormal
row references all memory in between.
Reference:
(1) http://www.centos.org/docs/5/html/5.2/Deployment_Guide/s2-proc-buddyinfo.html
(2) Wikipeia Buddy system https://en.wikipedia.org/wiki/Buddy_memory_allocation