public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* how to purposfully fragment memory?
@ 2007-03-20 17:43 Chris Friesen
       [not found] ` <a8f16e2b0703201215q78dfdd3du54c77be7c9d843e0@mail.gmail.com>
  0 siblings, 1 reply; 2+ messages in thread
From: Chris Friesen @ 2007-03-20 17:43 UTC (permalink / raw)
  To: linux-kernel


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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-03-20 21:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-20 17:43 how to purposfully fragment memory? Chris Friesen
     [not found] ` <a8f16e2b0703201215q78dfdd3du54c77be7c9d843e0@mail.gmail.com>
     [not found]   ` <4600393C.8030401@nortel.com>
2007-03-20 21:34     ` Dan Kruchinin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox