Re: [PATCH 2/2] mm: page_alloc: Add unlikely for MAX_ORDER check

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

 



(7/28/13 10:48 AM), SeungHun Lee wrote:
> "order >= MAX_ORDER" case is occur rarely.
> 
> So I add unlikely for this check.
> ---
>   mm/page_alloc.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index b8475ed..e644cf5 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -2408,7 +2408,7 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
>   	 * be using allocators in order of preference for an area that is
>   	 * too large.
>   	 */
> -	if (order >= MAX_ORDER) {
> +	if (unlikely(order >= MAX_ORDER)) {
>   		WARN_ON_ONCE(!(gfp_mask & __GFP_NOWARN));
>   		return NULL;

I don't think this improve any performance because here is a slowpath. However
I also don't find any issue to have this hint.

Acked-by: KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxxxxxxx>


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