From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752741AbcL2MAX (ORCPT ); Thu, 29 Dec 2016 07:00:23 -0500 Received: from outbound-smtp02.blacknight.com ([81.17.249.8]:39250 "EHLO outbound-smtp02.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752716AbcL2MAV (ORCPT ); Thu, 29 Dec 2016 07:00:21 -0500 Date: Thu, 29 Dec 2016 12:00:13 +0000 From: Mel Gorman To: Vlastimil Babka Cc: Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Joonsoo Kim , "Kirill A. Shutemov" , Johannes Weiner , Rik van Riel , Peter Zijlstra Subject: Re: [PATCH] mm, page_alloc: convert page_group_by_mobility_disable to static key Message-ID: <20161229120013.lscts45z6yec2ecg@techsingularity.net> References: <20161220134312.17332-1-vbabka@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20161220134312.17332-1-vbabka@suse.cz> User-Agent: Mutt/1.6.2 (2016-07-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 20, 2016 at 02:43:12PM +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 Acked-by: Mel Gorman -- Mel Gorman SUSE Labs