On 11/18/2013 10:54 AM, Naoya Horiguchi wrote: > diff --git a/mm/migrate.c b/mm/migrate.c > index cb5d152b58bc..661ff5f66591 100644 > --- a/mm/migrate.c > +++ b/mm/migrate.c > @@ -454,7 +454,8 @@ static void __copy_gigantic_page(struct page *dst, struct page *src, > struct page *src_base = src; > > for (i = 0; i < nr_pages; ) { > - cond_resched(); > + if (i % MAX_ORDER_NR_PAGES == 0) > + cond_resched(); > copy_highpage(dst, src); This is certainly OK on x86, but remember that MAX_ORDER can be overridden by a config variable. Just picking one at random: config FORCE_MAX_ZONEORDER int "Maximum zone order" range 9 64 if PPC64 && PPC_64K_PAGES ... Would it be OK to only resched once every 2^63 pages? ;) Really, though, a lot of things seem to have MAX_ORDER set up so that it's at 256MB or 512MB. That's an awful lot to do between rescheds. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>