From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754113AbcDNIeG (ORCPT ); Thu, 14 Apr 2016 04:34:06 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:58132 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753049AbcDNIeC (ORCPT ); Thu, 14 Apr 2016 04:34:02 -0400 Subject: Re: [PATCH v2] cpuset: use static key better and convert to new API To: Vlastimil Babka , Andrew Morton References: <1459931973-29247-1-git-send-email-vbabka@suse.cz> <1459934392-12756-1-git-send-email-vbabka@suse.cz> CC: Mel Gorman , Peter Zijlstra , David Rientjes , , , From: Zefan Li Message-ID: <570F54C2.2000300@huawei.com> Date: Thu, 14 Apr 2016 16:28:50 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1459934392-12756-1-git-send-email-vbabka@suse.cz> Content-Type: text/plain; charset="gbk" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.19.236] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020205.570F54E5.0097,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: b7b354677a877b1f2a8fd5389bb9e851 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2016/4/6 17:19, Vlastimil Babka wrote: > An important function for cpusets is cpuset_node_allowed(), which optimizes on > the fact if there's a single root CPU set, it must be trivially allowed. But > the check "nr_cpusets() <= 1" doesn't use the cpusets_enabled_key static key > the right way where static keys eliminate branching overhead with jump labels. > > This patch converts it so that static key is used properly. It's also switched > to the new static key API and the checking functions are converted to return > bool instead of int. We also provide a new variant __cpuset_zone_allowed() > which expects that the static key check was already done and they key was > enabled. This is needed for get_page_from_freelist() where we want to also > avoid the relatively slower check when ALLOC_CPUSET is not set in alloc_flags. > > Signed-off-by: Vlastimil Babka Looks good to me. Acked-by: Zefan Li