Re: [PATCH] mm: Add unlikely for current_order test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 17 Jun 2013, Zhang Yanfei wrote:

> > I don't understand the justification at all, current_order being unlikely 
> > greater than or equal to pageblock_order / 2 doesn't imply at all that 
> > it's unlikely that current_order is greater than or equal to 
> > pageblock_order.
> > 
> 
> hmmm... I am confused. Since current_order is >= pageblock_order / 2 is unlikely,
> why current_order is >= pageblock_order isn't unlikely. Or there are other
> tips?
> 
> Actually, I am also a little confused about why current_order should be
> unlikely greater than or equal to pageblock_order / 2. When borrowing pages
> with other migrate_type, we always search from MAX_ORDER-1, which is greater
> or equal to pageblock_order.
> 

Look at what is being done in the function: current_order loops down from 
MAX_ORDER-1 to the order passed.  It is not at all "unlikely" that 
current_order is greater than pageblock_order, or pageblock_order / 2.

MAX_ORDER is typically 11 and pageblock_order is typically 9 on x86.  
Integer division truncates, so pageblock_order / 2 is 4.  For the first 
eight iterations, it's guaranteed that current_order >= pageblock_order / 
2 if it even gets that far!

So just remove the unlikely() entirely, it's completely bogus.

--
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>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]