Messages in this thread | | | Date | Tue, 20 Mar 2007 11:43:56 -0600 | From | "Chris Friesen" <> | Subject | how to purposfully fragment memory? |
| |
I'm trying to test code paths dealing with fragmented memory, so I'd like to have a simple way to cause fragmented memory in the kernel. Is there any API in the kernel that would let me allocate two contiguous pages, then free one of them?
I tried the following, but it triggers an oops in free_page():
unsigned long addr = __get_free_pages(GFP_KERNEL|__GFP_NORETRY|__GFP_NOWARN, 1); if (!addr) break; free_page(addr+4096);
Thanks,
Chris - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |