From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752046AbdJZJKo (ORCPT ); Thu, 26 Oct 2017 05:10:44 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:53527 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932283AbdJZJKm (ORCPT ); Thu, 26 Oct 2017 05:10:42 -0400 X-ME-Sender: Date: Thu, 26 Oct 2017 20:10:36 +1100 From: "Tobin C. Harding" To: Greg KH Cc: "Jason A. Donenfeld" , kernel-hardening@lists.openwall.com, "Theodore Ts'o" , Linus Torvalds , Kees Cook , Paolo Bonzini , Tycho Andersen , "Roberts, William C" , Tejun Heo , Jordan Glover , Petr Mladek , Joe Perches , Ian Campbell , Sergey Senozhatsky , Catalin Marinas , Will Deacon , Steven Rostedt , Chris Fries , Dave Weinstein , Daniel Micay , Djalal Harouni , LKML Subject: Re: [PATCH v7] printk: hash addresses printed with %p Message-ID: <20171026091036.GI12341@eros> References: <20171025222727.GB12341@eros> <20171026070003.GA25583@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171026070003.GA25583@kroah.com> X-Mailer: Mutt 1.5.24 (2015-08-30) 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 On Thu, Oct 26, 2017 at 09:00:03AM +0200, Greg KH wrote: > On Thu, Oct 26, 2017 at 12:59:08AM +0200, Jason A. Donenfeld wrote: > > On Thu, Oct 26, 2017 at 12:27 AM, Tobin C. Harding wrote: > > > How good is unlikely()? > > > > It places that branch way at the bottom of the function so that it's > > less likely to pollute the icache. > > But always measure it. Lots of times (old numbers were 90% or so), we > get the marking wrong, so please, always benchmark the thing to verify > it actually is doing what you think it should be doing, otherwise it > could make the code worse. Does this come under 'premature optimization is the root of all evil'? Should we be leaving out things like unlikely() and __read_only until the code has been profiled? thanks, Tobin.