Re: [PATCH] mm, page_alloc: convert page_group_by_mobility_disable to static key
From: Rik van Riel
Date: Thu Dec 29 2016 - 11:08:24 EST
On Tue, 2016-12-20 at 14:43 +0100, Vlastimil Babka wrote:
> The flag is rarely enabled or even changed, so it's an ideal static
> key
> candidate. Since it's being checked in the page allocator fastpath
> via
> gfpflags_to_migratetype(), it may actually save some valuable cycles.
>
> Here's a diff excerpt from __alloc_pages_nodemask() assembly:
>
> ÂÂÂÂÂÂÂÂ-movlÂÂÂÂpage_group_by_mobility_disabled(%rip), %ecx
> +.byte 0x0f,0x1f,0x44,0x00,0
> ÂÂÂÂÂÂÂÂÂmovlÂÂÂÂ%r9d, %eax
> ÂÂÂÂÂÂÂÂÂshrlÂÂÂÂ$3, %eax
> ÂÂÂÂÂÂÂÂÂandlÂÂÂÂ$3, %eax
> ÂÂÂÂÂÂÂÂ-testlÂÂÂ%ecx, %ecx
> ÂÂÂÂÂÂÂÂ-movlÂÂÂÂ$0, %ecx
> ÂÂÂÂÂÂÂÂ-cmovneÂÂ%ecx, %eax
>
> I.e. a NOP instead of test, conditional move and some assisting
> moves.
>
> Signed-off-by: Vlastimil Babka <vbabka@xxxxxxx>
Acked-by: Rik van Riel <riel@xxxxxxxxxx>
--
All Rights Reversed.Attachment:
signature.asc
Description: This is a digitally signed message part