On Fri, 2011-04-08 at 14:28 +0200, Michal Nazarewicz wrote: > On Thu, 07 Apr 2011 19:21:05 +0200, Dave Hansen <dave@xxxxxxxxxxxxxxxxxx> > > + struct page *alloc_end = page + (1 << order); > > + struct page *used = page + PAGE_ALIGN(size)/PAGE_SIZE; > > - split_page(virt_to_page((void *)addr), order); > > + split_page(page, order); > > while (used < alloc_end) { > > - free_page(used); > > - used += PAGE_SIZE; > > + __free_page(used); > > + used++; > > } > > Have you thought about moving this loop to a separate function, ie. > _free_page_range(start, end)? I'm asking because this loop appears > in two places and my CMA would also benefit from such a function. It's actually perilously close to free_pages_exact(). I'll try to make it usable for this case as well. -- Dave -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxxx For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>