From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751358AbdBWOOs (ORCPT ); Thu, 23 Feb 2017 09:14:48 -0500 Received: from mga05.intel.com ([192.55.52.43]:24839 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751169AbdBWOOr (ORCPT ); Thu, 23 Feb 2017 09:14:47 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,198,1484035200"; d="scan'208";a="1114644289" Subject: Re: [PATCH] x86: Implement __WARN using UD0 To: Peter Zijlstra , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" References: <20170223132813.GB6515@twins.programming.kicks-ass.net> Cc: linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, bp@alien8.de, jpoimboe@redhat.com, richard.weinberger@gmail.com From: Arjan van de Ven Message-ID: Date: Thu, 23 Feb 2017 06:14:45 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <20170223132813.GB6515@twins.programming.kicks-ass.net> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/23/2017 5:28 AM, Peter Zijlstra wrote: > > By using "UD0" for WARNs we remove the function call and its possible > __FILE__ and __LINE__ immediate arguments from the instruction stream. > > Total image size will not change much, what we win in the instruction > stream we'll loose because of the __bug_table entries. Still, saves on > I$ footprint and the total image size does go down a bit. well I am a little sceptical; WARNs are rare so the code (other than the test) should be waaay out of line already (unlikely() and co). And I assume you're not removing the __FILE__ and __LINE__ info, since that info is actually high value for us developers... so what are you actually saving? (icache saving is only real if the line that the cold code lives on would actually end up in icache for other reasons; I would hope the compiler puts the out of line code WAY out of line)