Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932945AbcDEPMD (ORCPT ); Tue, 5 Apr 2016 11:12:03 -0400 Received: from mail.skyhub.de ([78.46.96.112]:59920 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758538AbcDEPMA (ORCPT ); Tue, 5 Apr 2016 11:12:00 -0400 Date: Tue, 5 Apr 2016 17:11:56 +0200 From: Borislav Petkov To: Brian Gerst Cc: X86 ML , LKML Subject: Re: [PATCH 1/6] x86/fpu/regset: Use boot_cpu_has() Message-ID: <20160405151156.GE17541@pd.tnic> References: <1459837795-2588-1-git-send-email-bp@alien8.de> <1459837795-2588-2-git-send-email-bp@alien8.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 908 Lines: 28 On Tue, Apr 05, 2016 at 09:51:55AM -0400, Brian Gerst wrote: > I think the general rule should be always use static_cpu_has() for > runtime checks, since it reduces down to a single jmp/nop instruction > after alternatives run. Even if it's not a hot path, it saves a bit > of runtime memory. So gcc generates a MOV and a TEST for boot_cpu_has(). Not exactly the bloat or slowdown. So I look at those differently: static_cpu_has() a) should be used on hotpaths b) is used as such to annotate those - i.e., "ah, there's a static_cpu_has(), this is a hot path, I better be careful what I'm doing here." boot_cpu_has() in all the rest. And saving a couple of bytes per call site but increasing alternatives application time by milli- or microseconds... Meh. I don't see it being really worth the trouble. But this is just me. -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply.