Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932746Ab1C3QTL (ORCPT ); Wed, 30 Mar 2011 12:19:11 -0400 Received: from terminus.zytor.com ([198.137.202.10]:33606 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755049Ab1C3QTH (ORCPT ); Wed, 30 Mar 2011 12:19:07 -0400 Message-ID: <4D935774.302@kernel.org> Date: Wed, 30 Mar 2011 09:16:52 -0700 From: "H. Peter Anvin" Organization: Linux Kernel Organization, Inc. User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Thunderbird/3.1.7 MIME-Version: 1.0 To: Andi Kleen CC: Tejun Heo , Ingo Molnar , Thomas Gleixner , x86@kernel.org, Christoph Lameter , linux-kernel@vger.kernel.org, Andrew Morton , Pekka Enberg Subject: Re: [PATCH tip:x86/mm 1/3] x86: A fast way to check capabilities of the current cpu References: <20110312115010.GC2005@htj.dyndns.org> <4D93531F.5080403@zytor.com> In-Reply-To: <4D93531F.5080403@zytor.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1003 Lines: 28 On 03/30/2011 08:58 AM, H. Peter Anvin wrote: > On 03/14/2011 12:49 PM, Andi Kleen wrote: >> Tejun Heo writes: >> >>> Add this_cpu_has() which determines if the current cpu has a certain >>> ability using a segment prefix and a bit test operation. >> >> >> Hmm: if the CPU capability is really tested in a performance critical >> path, wouldn't it even be better to just use static_branch() now? >> > > We have static_cpu_has() for this specific purpose (it actually predates > static_branch()). > Note that static_cpu_has() has two caveats: 1. Before alternatives patching, it will always be false. 2. It is the equivalent of boot_cpu_has(), i.e. the intersection of all the CPU feature sets (available at boot time, obviously.) -hpa -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/