Re: how to purposfully fragment memory?

From: Dan Kruchinin
Date: Tue Mar 20 2007 - 17:34:31 EST


On 3/20/07, Chris Friesen <cfriesen@xxxxxxxxxx> wrote:
Asgard wrote:

> btw, can you describe your aim in details?

I'm doing some work on a network device driver. We were having jumbo
frame issues after being up for a month or so because it couldn't
allocate enough contiguous memory.

We've got a new code path now that doesn't need large contiguous
allocations, so I'd like to demonstrate it by forcing the system to
become severely fragmented.

Chris


and by the way, you can try to use void split_page(struct page *page,
unsigned int order) function, but keep in mind, that it's not
recommended to use it in drivers:
/*
* split_page takes a non-compound higher-order page, and splits it into
* n (1<<order) sub-pages: page[0..n]
* Each sub-page must be freed individually.
*
* Note: this is probably too low level an operation for use in drivers.
* Please consult with lkml before using this in your driver.
*/
void split_page(struct page *page, unsigned int order)

Good luck.
Dan.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/